From bfd5b919baca5c63bb3837836af55b473c78be6f Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sun, 5 Jun 2016 17:45:41 +0000 Subject: Hide options when permission is not given. git-svn-id: http://svn.redmine.org/redmine/trunk@15468 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- public/javascripts/application.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'public') diff --git a/public/javascripts/application.js b/public/javascripts/application.js index 743b14ff6..347611bb2 100644 --- a/public/javascripts/application.js +++ b/public/javascripts/application.js @@ -719,9 +719,10 @@ function toggleDisabledOnChange() { var checked = $(this).is(':checked'); $($(this).data('disables')).attr('disabled', checked); $($(this).data('enables')).attr('disabled', !checked); + $($(this).data('shows')).toggle(checked); } function toggleDisabledInit() { - $('input[data-disables], input[data-enables]').each(toggleDisabledOnChange); + $('input[data-disables], input[data-enables], input[data-shows]').each(toggleDisabledOnChange); } (function ( $ ) { @@ -751,7 +752,7 @@ function toggleDisabledInit() { }( jQuery )); $(document).ready(function(){ - $('#content').on('change', 'input[data-disables], input[data-enables]', toggleDisabledOnChange); + $('#content').on('change', 'input[data-disables], input[data-enables], input[data-shows]', toggleDisabledOnChange); toggleDisabledInit(); }); -- cgit v1.2.3