diff --git a/templates/backOffice/default/includes/module-block.html b/templates/backOffice/default/includes/module-block.html index 386b28e6f..a7191b7c6 100644 --- a/templates/backOffice/default/includes/module-block.html +++ b/templates/backOffice/default/includes/module-block.html @@ -38,12 +38,9 @@
- - - {if $CONFIGURABLE == 1} {loop type="auth" name="can_change" role="ADMIN" module=$CODE access="VIEW"} - {intl l="Configure"} + {intl l="Configure"} {/loop} {/if} diff --git a/templates/backOffice/default/modules.html b/templates/backOffice/default/modules.html index 12d918efc..c730fa4a4 100644 --- a/templates/backOffice/default/modules.html +++ b/templates/backOffice/default/modules.html @@ -84,13 +84,24 @@ $(document).ready(function() { var url_management = "{url path="/admin/module/toggle-activation/"}"; $(".module-activation").on("switch-change", function(e, data){ + + var module_id = $(this).data('id'); + var is_checked = data.value; + $('body').append(''); $.ajax({ url: url_management+$(this).data('id') }).done(function(){ $("#loading-event").remove(); }) - .fail(function(jqXHR, textStatus, errorThrown){ + .success(function() { + if (is_checked) + $('#config-btn-' + module_id).removeClass('disabled'); + else + $('#config-btn-' + module_id).addClass('disabled'); + + }) + .fail(function(jqXHR, textStatus, errorThrown){ $("#loading-event").remove(); $('#module-failed-body').html(jqXHR.responseJSON.error); $("#module-failed").modal("show");