Use chickpea listen_form function in map_form.html
This commit is contained in:
parent
4d4989a775
commit
a92eafe9ac
1 changed files with 1 additions and 14 deletions
|
@ -16,18 +16,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 {
|
|
||||||
$("#map_edit").parent().empty().append(data.html);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
'dataType': 'json'
|
|
||||||
});
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
Loading…
Reference in a new issue