0002-Use-icon-icon-classes-for-expandable-elements.patch

Marius BALTEANU, 2019-05-29 23:36

Download (8.79 KB)

View differences:

app/views/issues/_list.html.erb
24 24
    <% reset_cycle %>
25 25
    <tr class="group open">
26 26
      <td colspan="<%= query.inline_columns.size + 2 %>">
27
        <span class="expander" onclick="toggleRowGroup(this);">&nbsp;</span>
27
        <span class="expander icon icon-expended" onclick="toggleRowGroup(this);">&nbsp;</span>
28 28
        <span class="name"><%= group_name %></span> <span class="badge badge-count count"><%= group_count %></span> <span class="totals"><%= group_totals %></span>
29 29
        <%= link_to_function("#{l(:button_collapse_all)}/#{l(:button_expand_all)}",
30 30
                             "toggleAllRowGroups(this)", :class => 'toggle-all') %>
app/views/repositories/_dir_list_content.html.erb
7 7
<td style="padding-left: <%=18 * depth%>px;" class="<%=
8 8
           @repository.report_last_commit ? "filename" : "filename_no_report" %>">
9 9
<% if entry.is_dir? %>
10
<span class="expander" onclick="scmEntryClick('<%= tr_id %>', '<%= escape_javascript(url_for(
10
<span class="expander icon icon-collapsed" onclick="scmEntryClick('<%= tr_id %>', '<%= escape_javascript(url_for(
11 11
                       :action => 'show',
12 12
                       :id     => @project,
13 13
                       :repository_id => @repository.identifier_param,
app/views/timelog/_list.html.erb
20 20
    <% reset_cycle %>
21 21
    <tr class="group open">
22 22
      <td colspan="<%= @query.inline_columns.size + 2 %>">
23
        <span class="expander" onclick="toggleRowGroup(this);">&nbsp;</span>
23
        <span class="expander icon icon-expended" onclick="toggleRowGroup(this);">&nbsp;</span>
24 24
        <span class="name"><%= group_name %></span>
25 25
        <% if group_count %>
26 26
        <span class="badge badge-count count"><%= group_count %></span>
app/views/trackers/fields.html.erb
20 20
    <tbody>
21 21
      <tr class="group open">
22 22
        <td colspan="<%= @trackers.size + 1 %>">
23
          <span class="expander" onclick="toggleRowGroup(this);">&nbsp;</span>
23
          <span class="expander icon icon-expended" onclick="toggleRowGroup(this);">&nbsp;</span>
24 24
          <%= l(:field_core_fields) %>
25 25
        </td>
26 26
      </tr>
......
44 44
      <% if @custom_fields.any? %>
45 45
        <tr class="group open">
46 46
          <td colspan="<%= @trackers.size + 1 %>">
47
            <span class="expander" onclick="toggleRowGroup(this);">&nbsp;</span>
47
            <span class="expander icon icon-expended" onclick="toggleRowGroup(this);">&nbsp;</span>
48 48
            <%= l(:label_custom_field_plural) %>
49 49
          </td>
50 50
        </tr>
app/views/workflows/permissions.html.erb
55 55
    <tbody>
56 56
      <tr class="group open">
57 57
        <td colspan="<%= @statuses.size + 1 %>">
58
          <span class="expander" onclick="toggleRowGroup(this);">&nbsp;</span>
58
          <span class="expander icon icon-expended" onclick="toggleRowGroup(this);">&nbsp;</span>
59 59
          <%= l(:field_core_fields) %>
60 60
        </td>
61 61
      </tr>
......
75 75
      <% if @custom_fields.any? %>
76 76
        <tr class="group open">
77 77
          <td colspan="<%= @statuses.size + 1 %>">
78
            <span class="expander" onclick="toggleRowGroup(this);">&nbsp;</span>
78
            <span class="expander icon icon-expended" onclick="toggleRowGroup(this);">&nbsp;</span>
79 79
            <%= l(:label_custom_field_plural) %>
80 80
          </td>
81 81
        </tr>
lib/redmine/helpers/gantt.rb
742 742
          }
743 743
        end
744 744
        if has_children
745
          content = view.content_tag(:span, nil, :class => :expander) + content
745
          content = view.content_tag(:span, nil, :class => 'icon icon-expended expander') + content
746 746
          tag_options[:class] += ' open'
747 747
        else
748 748
          if params[:indent]
public/javascripts/application.js
32 32
  var tr = $(el).parents('tr').first();
33 33
  var n = tr.next();
34 34
  tr.toggleClass('open');
35
  $(el).toggleClass('icon-expended icon-collapsed');
35 36
  while (n.length && !n.hasClass('group')) {
36 37
    n.toggle();
37 38
    n = n.next('tr');
......
43 44
  tbody.children('tr').each(function(index) {
44 45
    if ($(this).hasClass('group')) {
45 46
      $(this).removeClass('open');
47
      $(this).find('.expander').switchClass('icon-expended', 'icon-collapsed');
46 48
    } else {
47 49
      $(this).hide();
48 50
    }
......
54 56
  tbody.children('tr').each(function(index) {
55 57
    if ($(this).hasClass('group')) {
56 58
      $(this).addClass('open');
59
      $(this).find('.expander').switchClass('icon-collapsed', 'icon-expended');
57 60
    } else {
58 61
      $(this).show();
59 62
    }
......
477 480
    var el = $('#'+id);
478 481
    if (el.hasClass('open')) {
479 482
        collapseScmEntry(id);
483
        el.find('.expander').switchClass('icon-expended', 'icon-collapsed');
480 484
        el.addClass('collapsed');
481 485
        return false;
482 486
    } else if (el.hasClass('loaded')) {
483 487
        expandScmEntry(id);
488
        el.find('.expander').switchClass('icon-collapsed', 'icon-expended');
484 489
        el.removeClass('collapsed');
485 490
        return false;
486 491
    }
......
493 498
      success: function(data) {
494 499
        el.after(data);
495 500
        el.addClass('open').addClass('loaded').removeClass('loading');
501
        el.find('.expander').switchClass('icon-collapsed', 'icon-expended');
496 502
      }
497 503
    });
498 504
    return true;
public/javascripts/gantt.js
240 240
  var iconChange = null;
241 241
  if(subject.hasClass('open'))
242 242
    iconChange = function(element){
243
      $(element).find('.expander').switchClass('icon-expended', 'icon-collapsed');
243 244
      $(element).removeClass('open');
244 245
    };
245 246
  else
246 247
    iconChange = function(element){
248
      $(element).find('.expander').switchClass('icon-collapsed', 'icon-expended');
247 249
      $(element).addClass('open');
248 250
    };
249 251
  iconChange(subject);
public/stylesheets/application.css
288 288
tr.entry.file td.filename a { margin-left: 16px; }
289 289
tr.entry.file td.filename_no_report a { margin-left: 16px; }
290 290

  
291
tr span.expander, .gantt_subjects div > span.expander {background: url(../images/arrow_right.png) no-repeat 2px 50%; padding-left: 8px; margin-left: 0; cursor: pointer;}
292
tr.open span.expander, .gantt_subjects div.open > span.expander {background-image: url(../images/arrow_down.png);}
291
tr span.expander, .gantt_subjects div > span.expander {background-position: 2px 50%; padding-left: 8px; margin-left: 0; cursor: pointer;}
293 292
.gantt_subjects div > span.expander {padding-left: 12px;}
294 293
.gantt_subjects div > span .icon-gravatar {float: none;}
295 294

  
296
-