mirror of
https://github.com/Hopiu/wagtail.git
synced 2026-05-20 21:11:55 +00:00
Add optional error callback to ModalWorkflow
This commit is contained in:
parent
1eb38a8b7c
commit
5305a5a281
1 changed files with 3 additions and 2 deletions
|
|
@ -12,6 +12,7 @@ function ModalWorkflow(opts) {
|
|||
|
||||
var self = {};
|
||||
var responseCallbacks = opts.responses || {};
|
||||
var errorCallback = opts.onError || function () {};
|
||||
|
||||
/* remove any previous modals before continuing (closing doesn't remove them from the dom) */
|
||||
$('body > .modal').remove();
|
||||
|
|
@ -26,11 +27,11 @@ function ModalWorkflow(opts) {
|
|||
self.body = container.find('.modal-body');
|
||||
|
||||
self.loadUrl = function(url, urlParams) {
|
||||
$.get(url, urlParams, self.loadResponseText, 'text');
|
||||
$.get(url, urlParams, self.loadResponseText, 'text').fail(errorCallback);
|
||||
};
|
||||
|
||||
self.postForm = function(url, formData) {
|
||||
$.post(url, formData, self.loadResponseText, 'text');
|
||||
$.post(url, formData, self.loadResponseText, 'text').fail(errorCallback);
|
||||
};
|
||||
|
||||
self.ajaxifyForm = function(formSelector) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue