From b4a2b23025aba0e635f024687a4ff20a8f13cb85 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Thu, 13 Mar 2014 17:33:06 +0000 Subject: [PATCH 1/1] Block submission of the export form when the area is too large --- app/assets/javascripts/index/export.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/assets/javascripts/index/export.js b/app/assets/javascripts/index/export.js index 6e6867e5b..3210bf1d1 100644 --- a/app/assets/javascripts/index/export.js +++ b/app/assets/javascripts/index/export.js @@ -53,6 +53,10 @@ OSM.Export = function(map) { $("#export_commit").toggle(getBounds().getSize() < OSM.MAX_REQUEST_AREA); } + function checkSubmit(e) { + if (getBounds().getSize() > OSM.MAX_REQUEST_AREA) e.preventDefault(); + } + page.pushstate = page.popstate = function(path) { $("#export_tab").addClass("current"); OSM.loadSidebarContent(path, page.load); @@ -66,6 +70,7 @@ OSM.Export = function(map) { $("#maxlat, #minlon, #maxlon, #minlat").change(boundsChanged); $("#drag_box").click(enableFilter); $("#sidebar_content .close").on("click", page.minimizeSidebar); + $(".export_form").on("submit", checkSubmit); update(); return map.getState(); -- 2.39.5