From 6294e9ae59d553278e733d0923e06160b3ae51c2 Mon Sep 17 00:00:00 2001 From: Aaron Lidman Date: Thu, 7 Nov 2013 09:12:06 -0800 Subject: [PATCH] Hide export button when export area is too large, closes #30 --- app/assets/javascripts/index/export.js | 1 + app/assets/stylesheets/common.css.scss | 2 +- app/views/site/export.html.erb | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/index/export.js b/app/assets/javascripts/index/export.js index 23c503236..199f226f5 100644 --- a/app/assets/javascripts/index/export.js +++ b/app/assets/javascripts/index/export.js @@ -46,6 +46,7 @@ OSM.Export = function(map) { function validateControls() { $("#export_osm_too_large").toggle(getBounds().getSize() > OSM.MAX_REQUEST_AREA); + $("#export_commit").toggle(getBounds().getSize() < OSM.MAX_REQUEST_AREA); } page.pushstate = page.popstate = function(path) { diff --git a/app/assets/stylesheets/common.css.scss b/app/assets/stylesheets/common.css.scss index dc38ec6c3..448ba9e2b 100644 --- a/app/assets/stylesheets/common.css.scss +++ b/app/assets/stylesheets/common.css.scss @@ -1192,7 +1192,7 @@ a.donate { /* Rules for export information which appears in the popout sidebar */ -.export_bounds { +.export_bounds, .export_button { text-align: center; } diff --git a/app/views/site/export.html.erb b/app/views/site/export.html.erb index f071c0b43..94a9a295d 100644 --- a/app/views/site/export.html.erb +++ b/app/views/site/export.html.erb @@ -20,7 +20,7 @@

<%= t'export.start.licence' %><%= raw t'export.start.export_details' %>

-
+

<%= t'export.start.too_large.heading' %><%= t'export.start.too_large.body' %>

@@ -40,7 +40,7 @@
-
+
<%= submit_tag t('export.start.export_button'), :id => "export_commit" %>
<% end %> -- 2.39.5