From ee34c4e2ddc8bf9d5ec2e86d3065a2045088a11f Mon Sep 17 00:00:00 2001
From: Yohan Boniface <yb@enix.org>
Date: Mon, 26 Nov 2012 11:43:56 +0100
Subject: [PATCH] Use chickpea listen_form method in map_update_tilelayers

---
 .../chickpea/map_update_tilelayers.html       | 20 +------------------
 1 file changed, 1 insertion(+), 19 deletions(-)

diff --git a/youmap/templates/chickpea/map_update_tilelayers.html b/youmap/templates/chickpea/map_update_tilelayers.html
index e214ec6..592b78f 100644
--- a/youmap/templates/chickpea/map_update_tilelayers.html
+++ b/youmap/templates/chickpea/map_update_tilelayers.html
@@ -19,23 +19,5 @@
 </form>
 
 <script type="text/javascript">
-    $("#map_edit").on("submit", function (e) {
-        e.preventDefault();
-        L.Util.Xhr.submit_form("map_edit", {
-            'callback': function (data) {
-                if (data.redirect) {
-                    window.location = data.redirect;
-                }
-                else if (data.info) {
-                    $div = $('<div>').addClass('alert-box success').html(data.info);
-                    $div.append('<a href="#" class="close">&times;</a>');
-                    $("#map").prepend($div);
-                }
-                else {
-                    $("#map_edit").parent().empty().append(data.html);
-                }
-            },
-            'dataType': 'json'
-        });
-    });
+    L.Util.Xhr.listen_form('map_edit');
 </script>
\ No newline at end of file
-- 
GitLab