Project

General

Profile

Defect #32754 » 0001-Fix-missing-arrow-icon-of-collapse.patch

Marius BĂLTEANU, 2020-01-07 15:07

View differences:

lib/redmine/wiki_formatting/macros.rb
234 234
        hide_label = args[1] || args[0] || l(:button_hide)
235 235
        js = "$('##{html_id}-show, ##{html_id}-hide').toggle(); $('##{html_id}').fadeToggle(150);"
236 236
        out = ''.html_safe
237
        out << link_to_function(show_label, js, :id => "#{html_id}-show", :class => 'collapsible collapsed')
238
        out << link_to_function(hide_label, js, :id => "#{html_id}-hide", :class => 'collapsible', :style => 'display:none;')
237
        out << link_to_function(show_label, js, :id => "#{html_id}-show", :class => 'icon icon-collapsed collapsible')
238
        out << link_to_function(hide_label, js, :id => "#{html_id}-hide", :class => 'icon icon-expended collapsible', :style => 'display:none;')
239 239
        out << content_tag('div', textilizable(text, :object => obj, :headings => false, :inline_attachments => @@inline_attachments), :id => html_id, :class => 'collapsed-text', :style => 'display:none;')
240 240
        out
241 241
      end
test/unit/lib/redmine/wiki_formatting/macros_test.rb
215 215

  
216 216
      assert_select_in result, 'div.collapsed-text'
217 217
      assert_select_in result, 'strong', :text => 'Collapsed'
218
      assert_select_in result, 'a.collapsible.collapsed', :text => 'Show'
219
      assert_select_in result, 'a.collapsible', :text => 'Hide'
218
      assert_select_in result, 'a.collapsible.icon-collapsed', :text => 'Show'
219
      assert_select_in result, 'a.collapsible.icon-expended', :text => 'Hide'
220 220
    end
221 221
  end
222 222

  
......
226 226

  
227 227
    assert_select_in result, 'div.collapsed-text'
228 228
    assert_select_in result, 'strong', :text => 'Collapsed'
229
    assert_select_in result, 'a.collapsible.collapsed', :text => 'Example'
230
    assert_select_in result, 'a.collapsible', :text => 'Example'
229
    assert_select_in result, 'a.collapsible.icon-collapsed', :text => 'Example'
230
    assert_select_in result, 'a.collapsible.icon-expended', :text => 'Example'
231 231
  end
232 232

  
233 233
  def test_macro_collapse_with_two_args
......
236 236

  
237 237
    assert_select_in result, 'div.collapsed-text'
238 238
    assert_select_in result, 'strong', :text => 'Collapsed'
239
    assert_select_in result, 'a.collapsible.collapsed', :text => 'Show example'
240
    assert_select_in result, 'a.collapsible', :text => 'Hide example'
239
    assert_select_in result, 'a.collapsible.icon-collapsed', :text => 'Show example'
240
    assert_select_in result, 'a.collapsible.icon-expended', :text => 'Hide example'
241 241
  end
242 242

  
243 243
  def test_macro_collapse_should_not_break_toc
(2-2/2)