erp5_web_monitoring: fix delete opml loop bug
Showing
... | @@ -10,23 +10,20 @@ | ... | @@ -10,23 +10,20 @@ |
///////////////////////////////////////////////////////////////// | ///////////////////////////////////////////////////////////////// | ||
.declareAcquiredMethod("redirect", "redirect") | .declareAcquiredMethod("redirect", "redirect") | ||
.declareAcquiredMethod("jio_remove", "jio_remove") | .declareAcquiredMethod("jio_remove", "jio_remove") | ||
.declareAcquiredMethod("notifySubmitting", "notifySubmitting") | |||
.declareAcquiredMethod("notifySubmitted", 'notifySubmitted') | .declareAcquiredMethod("notifySubmitted", 'notifySubmitted') | ||
.declareMethod("render", function (options) { | .declareMethod("render", function (options) { | ||
var gadget = this; | var gadget = this; | ||
return gadget.jio_remove(options.jio_key) | |||
return gadget.notifySubmitting() | |||
.push(function () { | |||
return gadget.jio_remove(options.jio_key); | |||
}) | |||
.push(function () { | .push(function () { | ||
return gadget.notifySubmitted({message: "Document Deleted", status: "success"}); | return gadget.notifySubmitted({message: "Document Deleted", status: "success"}) | ||
}, function (error) { | |||
return gadget.notifySubmitted({message: error.message, status: "error"}) | |||
|
|||
}) | }) | ||
.push(function () { | .push(function () { | ||
return gadget.redirect({command: 'change', options: { | return gadget.redirect({command: 'change', options: { | ||
page: options.return_url || 'settings_configurator' | page: options.return_url || 'settings_configurator' | ||
}}); | }}); | ||
}); | }); | ||
}); | }, {mutex: 'render'}); | ||
}(window, rJS)); | }(window, rJS)); |