change status of the toggle button when module activation fails. Fix #287
This commit is contained in:
@@ -103,7 +103,8 @@
|
|||||||
var url_management = "{url path="/admin/module/toggle-activation/"}";
|
var url_management = "{url path="/admin/module/toggle-activation/"}";
|
||||||
$(".module-activation").on("switch-change", function(e, data){
|
$(".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;
|
var is_checked = data.value;
|
||||||
|
|
||||||
$('body').append('<div class="modal-backdrop fade in" id="loading-event"><div class="loading"></div></div>');
|
$('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){
|
.fail(function(jqXHR, textStatus, errorThrown){
|
||||||
|
checkbox.bootstrapSwitch('toggleState', true);
|
||||||
$("#loading-event").remove();
|
$("#loading-event").remove();
|
||||||
$('#module-failed-body').html(jqXHR.responseJSON.error);
|
$('#module-failed-body').html(jqXHR.responseJSON.error);
|
||||||
$("#module-failed").modal("show");
|
$("#module-failed").modal("show");
|
||||||
@@ -154,6 +156,7 @@
|
|||||||
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{/block}
|
{/block}
|
||||||
|
|
||||||
{block name="javascript-last-call"}
|
{block name="javascript-last-call"}
|
||||||
|
|||||||
Reference in New Issue
Block a user