Use chickpea listen_form method in map_update_tilelayers
This commit is contained in:
parent
a92eafe9ac
commit
ee34c4e2dd
1 changed files with 1 additions and 19 deletions
|
@ -19,23 +19,5 @@
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$("#map_edit").on("submit", function (e) {
|
L.Util.Xhr.listen_form('map_edit');
|
||||||
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">×</a>');
|
|
||||||
$("#map").prepend($div);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$("#map_edit").parent().empty().append(data.html);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
'dataType': 'json'
|
|
||||||
});
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
Loading…
Reference in a new issue