From c39d587c25cbf5a0bb6a9e83f3e54e0c0409afee Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Mon, 5 May 2014 16:05:03 +0200 Subject: [PATCH] change status of the toggle button when module activation fails. Fix #287 --- templates/backOffice/default/modules.html | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/templates/backOffice/default/modules.html b/templates/backOffice/default/modules.html index 948665ff5..05ead14e4 100644 --- a/templates/backOffice/default/modules.html +++ b/templates/backOffice/default/modules.html @@ -103,7 +103,8 @@ var url_management = "{url path="/admin/module/toggle-activation/"}"; $(".module-activation").on("switch-change", function(e, data){ - var module_id = $(this).data('id'); + var checkbox = $(this); + var module_id = checkbox.data('id'); var is_checked = data.value; $('body').append(''); @@ -120,6 +121,7 @@ }) .fail(function(jqXHR, textStatus, errorThrown){ + checkbox.bootstrapSwitch('toggleState', true); $("#loading-event").remove(); $('#module-failed-body').html(jqXHR.responseJSON.error); $("#module-failed").modal("show"); @@ -154,6 +156,7 @@ }); + {/block} {block name="javascript-last-call"}