diff options
author | Go MAEDA <maeda@farend.jp> | 2024-11-10 06:45:26 +0000 |
---|---|---|
committer | Go MAEDA <maeda@farend.jp> | 2024-11-10 06:45:26 +0000 |
commit | 624f9bf3d107488c67624de636171eeff10886ab (patch) | |
tree | 906dec8fd30982e3321e15c33a4b88ae8e1329cd /app/helpers | |
parent | 44408dcf1bd6b8fd530240b04145ff5a47d9183f (diff) | |
download | redmine-624f9bf3d107488c67624de636171eeff10886ab.tar.gz redmine-624f9bf3d107488c67624de636171eeff10886ab.zip |
Fixed duplicate "disabled" class in the context_menus_helper result (#23980, #41720).
Patch by Katsuya HIDAKA (user:hidakatsuya).
git-svn-id: https://svn.redmine.org/redmine/trunk@23226 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/helpers')
-rw-r--r-- | app/helpers/context_menus_helper.rb | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/app/helpers/context_menus_helper.rb b/app/helpers/context_menus_helper.rb index bfabbbb4e..cb8153549 100644 --- a/app/helpers/context_menus_helper.rb +++ b/app/helpers/context_menus_helper.rb @@ -20,19 +20,23 @@ module ContextMenusHelper def context_menu_link(name, url, options={}) label = name - options[:class] ||= '' + css_classes = [options[:class]] + if options.delete(:selected) - options[:class] += ' icon disabled' + css_classes << 'icon disabled' options[:disabled] = true label = sprite_icon('checked', name) end + if options.delete(:disabled) options.delete(:method) options.delete(:data) options[:onclick] = 'return false;' - options[:class] += ' disabled' + css_classes << 'disabled' url = '#' end + + options[:class] = class_names(css_classes) link_to label, url, options end |