Project

General

Profile

Patch #31433 » 0002-Use-the-regular-icon-icon-classes-for-collapsible-fi.patch

Marius BĂLTEANU, 2019-05-23 19:58

View differences:

app/views/queries/_query_form.html.erb
5 5
<div id="query_form_with_buttons" class="hide-when-print">
6 6
<div id="query_form_content">
7 7
  <fieldset id="filters" class="collapsible <%= @query.new_record? ? "" : "collapsed" %>">
8
    <legend onclick="toggleFieldset(this);"><%= l(:label_filter_plural) %></legend>
8
    <legend onclick="toggleFieldset(this);" class="icon icon-<%= @query.new_record? ? "expended" : "collapsed" %>"><%= l(:label_filter_plural) %></legend>
9 9
    <div style="<%= @query.new_record? ? "" : "display: none;" %>">
10 10
      <%= render :partial => 'queries/filters', :locals => {:query => @query} %>
11 11
    </div>
12 12
  </fieldset>
13 13

  
14 14
  <fieldset id="options" class="collapsible collapsed">
15
    <legend onclick="toggleFieldset(this);"><%= l(:label_options) %></legend>
15
    <legend onclick="toggleFieldset(this);" class="icon icon-collapsed"><%= l(:label_options) %></legend>
16 16
    <div style="display: none;">
17 17
      <table>
18 18
        <tr>
app/views/versions/index.html.erb
88 88
<% if @completed_versions.present? %>
89 89
<p>
90 90
  <%= link_to_function l(:label_completed_versions),
91
                       '$("#toggle-completed-versions").toggleClass("collapsed"); $("#completed-versions").toggle()',
92
                       :id => 'toggle-completed-versions', :class => 'collapsible collapsed' %>
91
                       '$("#toggle-completed-versions").toggleClass("icon-collapsed icon-expended"); $("#completed-versions").toggle()',
92
                       :id => 'toggle-completed-versions', :class => 'icon icon-collapsed collapsible' %>
93 93
  <ul id = "completed-versions" style = "display:none;">
94 94
    <% @completed_versions.each do |version| %>
95 95
      <li><%= link_to_version version %></li>
public/javascripts/application.js
72 72
function toggleFieldset(el) {
73 73
  var fieldset = $(el).parents('fieldset').first();
74 74
  fieldset.toggleClass('collapsed');
75
  fieldset.children('legend').toggleClass('icon-expended icon-collapsed');
75 76
  fieldset.children('div').toggle();
76 77
}
77 78

  
public/stylesheets/application.css
132 132
#admin-menu a {line-height:1.7em;}
133 133
#admin-menu a.selected {padding-left: 20px !important; background-position: 2px 40%;}
134 134

  
135
a.collapsible {padding-left: 12px; background: url(../images/arrow_down.png) no-repeat 0px 50%;}
136
a.collapsible.collapsed {background-image: url(../images/arrow_right.png);}
135
a.collapsible {padding-left: 12px; }
137 136

  
138 137
a#toggle-completed-versions {color:#999;}
139 138

  
......
518 517
#trackers_description dd {margin: 0; padding: 0 0 1em 0;}
519 518

  
520 519
fieldset.collapsible {border-width: 1px 0 0 0;}
521
fieldset.collapsible>legend { padding-left: 18px; background: url(../images/arrow_down.png) no-repeat 4px 40%; cursor:pointer; }
522
fieldset.collapsible.collapsed>legend { background-image: url(../images/arrow_right.png); }
520
fieldset.collapsible>legend { cursor:pointer; padding-left: 18px; background-position: 4px;}
523 521

  
524 522
fieldset#date-range p { margin: 2px 0 2px 0; }
525 523
fieldset#filters table { border-collapse: collapse; }
......
1498 1496
.icon-shared { background-image: url(../images/link.png); }
1499 1497
.icon-actions { background-image: url(../images/3_bullets.png); }
1500 1498
.icon-sort-handle { background-image: url(../images/reorder.png); }
1499
.icon-expended { background-image: url(../images/arrow_down.png); }
1500
.icon-collapsed { background-image: url(../images/arrow_right.png); }
1501 1501

  
1502 1502
.icon-file { background-image: url(../images/files/default.png); }
1503 1503
.icon-file.text-plain { background-image: url(../images/files/text.png); }
(2-2/8)