Prevented page from redirecting before JS had finished

This commit is contained in:
Mark Nelson 2015-12-09 13:34:52 +08:00
parent 3a63a6e00a
commit 5e29aebeb6

View file

@ -309,11 +309,16 @@ M.mod_customcert.rearrange = {
on: { on: {
failure: function(tid, response) { failure: function(tid, response) {
this.ajax_failure(response); this.ajax_failure(response);
e.preventDefault(); },
success: function() {
var formNode = e.currentTarget.ancestor('form', true);
window.location = formNode.getAttribute('action') + '?' + Y.QueryString.stringify({cmid:formNode.one('[name=cmid]').get('value')});
} }
}, },
context: this context: this
}) });
e.preventDefault();
}, },