From 162c356b23e236724c7a46e0e4d1778903d45ee5 Mon Sep 17 00:00:00 2001 From: Go MAEDA Date: Sun, 10 Nov 2024 06:40:07 +0000 Subject: [PATCH] Switched checked icon in context menu to SVG icon (#23980, #41720). Patch by Katsuya HIDAKA (user:hidakatsuya). git-svn-id: https://svn.redmine.org/redmine/trunk@23224 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/assets/stylesheets/context_menu.css | 5 +++-- app/helpers/context_menus_helper.rb | 6 ++++-- test/functional/context_menus_controller_test.rb | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/app/assets/stylesheets/context_menu.css b/app/assets/stylesheets/context_menu.css index 1b2b749ee..875564c8f 100644 --- a/app/assets/stylesheets/context_menu.css +++ b/app/assets/stylesheets/context_menu.css @@ -48,11 +48,12 @@ #context-menu li a.submenu { padding-right:16px; background:url("/arrow_right.png") right no-repeat; padding-left: 28px;} #context-menu li:hover { border:1px solid #628db6; background-color:#eef5fd; border-radius:3px; } #context-menu a:hover {color:#2A5685;} -#context-menu li.folder ul li a {padding-left: 20px;} +#context-menu li.folder ul li a:not(.icon) { + padding-left: 28px; +} #context-menu li.folder:hover { z-index:40; } #context-menu ul ul, #context-menu li:hover ul ul { display:none; } #context-menu li:hover ul, #context-menu li:hover li:hover ul { display:block; } -#context-menu a.icon-checked {background-position: 3px 40%;} /* selected element */ .context-menu-selection { background-color:#507AAA !important; color:#f8f8f8 !important; } diff --git a/app/helpers/context_menus_helper.rb b/app/helpers/context_menus_helper.rb index 0f208397c..bfabbbb4e 100644 --- a/app/helpers/context_menus_helper.rb +++ b/app/helpers/context_menus_helper.rb @@ -19,10 +19,12 @@ module ContextMenusHelper def context_menu_link(name, url, options={}) + label = name options[:class] ||= '' if options.delete(:selected) - options[:class] += ' icon icon-checked disabled' + options[:class] += ' icon disabled' options[:disabled] = true + label = sprite_icon('checked', name) end if options.delete(:disabled) options.delete(:method) @@ -31,7 +33,7 @@ module ContextMenusHelper options[:class] += ' disabled' url = '#' end - link_to h(name), url, options + link_to label, url, options end def bulk_update_custom_field_context_menu_link(field, text, value) diff --git a/test/functional/context_menus_controller_test.rb b/test/functional/context_menus_controller_test.rb index c8d4f798d..e10d2309c 100644 --- a/test/functional/context_menus_controller_test.rb +++ b/test/functional/context_menus_controller_test.rb @@ -221,7 +221,7 @@ class ContextMenusControllerTest < Redmine::ControllerTest assert_select 'a[href="#"]', :text => 'List' assert_select 'ul' do assert_select 'a', 3 - assert_select 'a.icon.icon-checked', :text => 'Bar' + assert_select 'a.icon', :text => 'Bar' end end end -- 2.39.5