Project

General

Profile

Patch #41720 » 0001-Switched-checked-icon-in-context-menu-to-SVG-icon.patch

Katsuya HIDAKA, 2024-11-09 13:54

View differences:

app/assets/stylesheets/context_menu.css
48 48
#context-menu li a.submenu { padding-right:16px; background:url("/arrow_right.png") right no-repeat; padding-left: 28px;}
49 49
#context-menu li:hover { border:1px solid #628db6; background-color:#eef5fd; border-radius:3px; }
50 50
#context-menu a:hover {color:#2A5685;}
51
#context-menu li.folder ul li a {padding-left: 20px;}
51
#context-menu li.folder ul li a:not(.icon) {
52
  padding-left: 28px;
53
}
52 54
#context-menu li.folder:hover { z-index:40; }
53 55
#context-menu ul ul, #context-menu  li:hover ul ul { display:none; }
54 56
#context-menu li:hover ul, #context-menu li:hover li:hover ul { display:block; }
55
#context-menu a.icon-checked {background-position: 3px 40%;}
56 57

  
57 58
/* selected element */
58 59
.context-menu-selection { background-color:#507AAA !important; color:#f8f8f8 !important; }
app/helpers/context_menus_helper.rb
19 19

  
20 20
module ContextMenusHelper
21 21
  def context_menu_link(name, url, options={})
22
    label = name
22 23
    options[:class] ||= ''
23 24
    if options.delete(:selected)
24
      options[:class] += ' icon icon-checked disabled'
25
      options[:class] += ' icon disabled'
25 26
      options[:disabled] = true
27
      label = sprite_icon('checked', name)
26 28
    end
27 29
    if options.delete(:disabled)
28 30
      options.delete(:method)
......
31 33
      options[:class] += ' disabled'
32 34
      url = '#'
33 35
    end
34
    link_to h(name), url, options
36
    link_to label, url, options
35 37
  end
36 38

  
37 39
  def bulk_update_custom_field_context_menu_link(field, text, value)
test/functional/context_menus_controller_test.rb
221 221
      assert_select 'a[href="#"]', :text => 'List'
222 222
      assert_select 'ul' do
223 223
        assert_select 'a', 3
224
        assert_select 'a.icon.icon-checked', :text => 'Bar'
224
        assert_select 'a.icon', :text => 'Bar'
225 225
      end
226 226
    end
227 227
  end
(1-1/5)