change status of the toggle button when module activation fails. Fix #287

This commit is contained in:
Manuel Raynaud
2014-05-05 16:05:03 +02:00
parent 5b968dbaa7
commit c39d587c25

View File

@@ -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('<div class="modal-backdrop fade in" id="loading-event"><div class="loading"></div></div>');
@@ -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 @@
});
</script>
{/block}
{block name="javascript-last-call"}