From 624f9bf3d107488c67624de636171eeff10886ab Mon Sep 17 00:00:00 2001 From: Go MAEDA Date: Sun, 10 Nov 2024 06:45:26 +0000 Subject: 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 --- app/helpers/context_menus_helper.rb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'app/helpers') 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 -- cgit v1.2.3