Commit 2e35eb70 authored by Łukasz Nowak's avatar Łukasz Nowak

erp5_web_monitoring: Avoid needless button disabling

parent 293e1536
...@@ -22,16 +22,10 @@ ...@@ -22,16 +22,10 @@
.declareAcquiredMethod("notifySubmitted", 'notifySubmitted') .declareAcquiredMethod("notifySubmitted", 'notifySubmitted')
.allowPublicAcquisition("jio_allDocs", function (param_list) { .allowPublicAcquisition("jio_allDocs", function (param_list) {
var gadget = this, var gadget = this;
destroy_element = gadget.element.querySelector("#destroyOPML");
return gadget.jio_allDocs(param_list[0]) return gadget.jio_allDocs(param_list[0])
.push(function (result) { .push(function (result) {
var i, value, len = result.data.total_rows; var i, value, len = result.data.total_rows;
if (result.data.total_rows === 0) {
destroy_element.setAttribute("disabled", "disabled");
} else if (destroy_element.getAttribute("disabled") === "disabled") {
destroy_element.setAttribute("disabled", "");
}
for (i = 0; i < len; i += 1) { for (i = 0; i < len; i += 1) {
if (result.data.rows[i].value.hasOwnProperty("active")) { if (result.data.rows[i].value.hasOwnProperty("active")) {
result.data.rows[i].value.active = { result.data.rows[i].value.active = {
...@@ -149,6 +143,7 @@ ...@@ -149,6 +143,7 @@
); );
element.setAttribute('rel', ''); element.setAttribute('rel', '');
if (success) { if (success) {
element.removeAttribute("disabled");
return gadget.redirect({"command": "reload"}); return gadget.redirect({"command": "reload"});
} }
}); });
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment