Hi,
How can I get the moveEnd to wait until a promise is resolved before ending completing?
Currently I have the following:
moveEnd: function(e) {
if (!isEventValid(e.start, e.end)) {
e.preventDefault();
return false;
}
$.when(getAssistance(e.event, e.start, e.end))
.done(function() {
window.location = "/new-url";
}).
fail(function() {
// 1
e.preventDefault();
return false;
});
}
(I dont know how to get out of this editor)
My problem is that the 'moveEnd' completes before the promise is complete. If the Promise resolved and the user redirected, its a non-issue, but if the promise is rejected, the move needs to be prevented.
Please advise, Thanks,
Grant