var n = tr.next();
tr.toggleClass('open');
$(el).toggleClass('icon-expanded icon-collapsed');
+ toggleExpendCollapseIcon(el)
while (n.length && !n.hasClass('group')) {
n.toggle();
n = n.next('tr');
}
}
+function toggleExpendCollapseIcon(el) {
+ if (el.classList.contains('icon-expanded')) {
+ updateSVGIcon(el, 'angle-down')
+ } else {
+ updateSVGIcon(el, 'angle-right')
+ }
+}
+
+function updateSVGIcon(element, icon) {
+ const iconElement = element.getElementsByTagName("use").item(0)
+
+ if (iconElement === null) {
+ return false;
+ }
+
+ const iconPath = iconElement.getAttribute('href');
+ iconElement.setAttribute('href', iconPath.replace(/#.*$/g, "#icon--" + icon))
+}
+
function collapseAllRowGroups(el) {
var tbody = $(el).parents('tbody').first();
tbody.children('tr').each(function(index) {
var fieldset = $(el).parents('fieldset').first();
fieldset.toggleClass('collapsed');
fieldset.children('legend').toggleClass('icon-expanded icon-collapsed');
+ toggleExpendCollapseIcon(fieldset.children('legend')[0])
fieldset.children('div').toggle();
}
$('#'+id).addClass('open');
}
-function switchScmFolderIcon(el, from, to) {
- var iconEl = el.find('svg use')
- var iconHref = iconEl.attr('href')
-
- iconEl.attr('href', iconHref.replace(from, to))
-}
-
function scmEntryClick(id, url) {
var el = $('#'+id);
if (el.hasClass('open')) {
collapseScmEntry(id);
el.find('.expander').switchClass('icon-expanded', 'icon-collapsed');
el.addClass('collapsed');
- switchScmFolderIcon(el, 'icon--folder-open', 'icon--folder')
+ updateSVGIcon(el[0], 'folder')
return false;
} else if (el.hasClass('loaded')) {
expandScmEntry(id);
el.find('.expander').switchClass('icon-collapsed', 'icon-expanded');
el.removeClass('collapsed');
- switchScmFolderIcon(el, 'icon--folder', 'icon--folder-open')
+ updateSVGIcon(el[0], 'folder-open')
return false;
}
success: function(data) {
el.after(data);
el.addClass('open').addClass('loaded').removeClass('loading');
- switchScmFolderIcon(el, 'icon--folder', 'icon--folder-open')
+ updateSVGIcon(el[0], 'folder-open')
el.find('.expander').switchClass('icon-collapsed', 'icon-expanded');
}
});
.icon-shared:not(:has(svg)) { background-image: url(/link.png); }
.icon-actions:not(:has(svg)) { background-image: url(/3_bullets.png); }
.icon-sort-handle:not(:has(svg)) { background-image: url(/reorder.png); }
-.icon-expanded { background-image: url(/arrow_down.png); }
-.icon-collapsed { background-image: url(/arrow_right.png); }
+.icon-expanded:not(:has(svg)) { background-image: url(/arrow_down.png); }
+.icon-collapsed:not(:has(svg)) { background-image: url(/arrow_right.png); }
.icon-bookmark:not(:has(svg)) { background-image: url(/tag_blue_delete.png); }
.icon-bookmark-off:not(:has(svg)) { background-image: url(/tag_blue_add.png); }
.icon-bookmarked-project:not(:has(svg)) { background-image: url(/tag_blue.png); }
<div id="query_form_with_buttons" class="hide-when-print">
<div id="query_form_content">
<fieldset id="filters" class="collapsible <%= @query.new_record? ? "" : "collapsed" %>">
- <legend onclick="toggleFieldset(this);" class="icon icon-<%= @query.new_record? ? "expanded" : "collapsed" %>"><%= l(:label_filter_plural) %></legend>
+ <legend onclick="toggleFieldset(this);" class="icon icon-<%= @query.new_record? ? "expanded" : "collapsed" %>">
+ <%= sprite_icon(@query.new_record? ? "angle-down" : "angle-right") %>
+ <%= l(:label_filter_plural) %>
+ </legend>
<div style="<%= @query.new_record? ? "" : "display: none;" %>">
<%= render :partial => 'queries/filters', :locals => {:query => @query} %>
</div>
<div id="query_form_with_buttons" class="hide-when-print">
<div id="query_form_content">
<fieldset id="filters" class="collapsible <%= @query.new_record? ? "" : "collapsed" %>">
- <legend onclick="toggleFieldset(this);" class="icon icon-<%= @query.new_record? ? "expanded" : "collapsed" %>"><%= l(:label_filter_plural) %></legend>
+ <legend onclick="toggleFieldset(this);" class="icon icon-<%= @query.new_record? ? "expanded" : "collapsed" %>">
+ <%= sprite_icon(@query.new_record? ? "angle-down" : "angle-right") %>
+ <%= l(:label_filter_plural) %>
+ </legend>
<div style="<%= @query.new_record? ? "" : "display: none;" %>">
<%= render :partial => 'queries/filters', :locals => {:query => @query} %>
</div>
</fieldset>
<fieldset id="options" class="collapsible collapsed">
- <legend onclick="toggleFieldset(this);" class="icon icon-collapsed"><%= l(:label_options) %></legend>
+ <legend onclick="toggleFieldset(this);" class="icon icon-collapsed">
+ <%= sprite_icon("angle-right") %>
+ <%= l(:label_options) %>
+ </legend>
<div style="display: none;">
<div>
<fieldset>
</fieldset>
<fieldset class="box tabular collapsible collapsed">
- <legend onclick="toggleFieldset(this);" class="icon icon-collapsed"><%= l(:label_relations_mapping) %></legend>
+ <legend onclick="toggleFieldset(this);" class="icon icon-collapsed">
+ <%= sprite_icon("angle-right") %>
+ <%= l(:label_relations_mapping) %>
+ </legend>
<div id="relations-mapping" style="display: none;">
<%= render :partial => 'issues_relations_mapping' %>
</div>
<% reset_cycle %>
<tr class="group open">
<td colspan="<%= query.inline_columns.size + 2 %>">
- <span class="expander icon icon-expanded" onclick="toggleRowGroup(this);"> </span>
+ <span class="expander icon icon-expanded" onclick="toggleRowGroup(this);"><%= sprite_icon("angle-down") %></span>
<span class="name"><%= group_name %></span> <span class="badge badge-count count"><%= group_count %></span> <span class="totals"><%= group_totals %></span>
<%= link_to_function("#{l(:button_collapse_all)}/#{l(:button_expand_all)}",
"toggleAllRowGroups(this)", :class => 'toggle-all') %>
<% reset_cycle %>
<tr class="group open">
<td colspan="<%= @query.inline_columns.size %>">
- <span class="expander icon icon-expanded" onclick="toggleRowGroup(this);"> </span>
+ <span class="expander icon icon-expanded" onclick="toggleRowGroup(this);"><%= sprite_icon("angle-down") %></span>
<span class="name"><%= group_name %></span>
<% if group_count %>
<span class="count"><%= group_count %></span>
<div id="query_form_with_buttons" class="hide-when-print">
<div id="query_form_content">
<fieldset id="filters" class="collapsible <%= @query.new_record? ? "" : "collapsed" %>">
- <legend onclick="toggleFieldset(this);" class="icon icon-<%= @query.new_record? ? "expanded" : "collapsed" %>"><%= l(:label_filter_plural) %></legend>
+ <legend onclick="toggleFieldset(this);" class="icon icon-<%= @query.new_record? ? "expanded" : "collapsed" %>">
+ <%= sprite_icon(@query.new_record? ? "angle-down" : "angle-right") %>
+ <%= l(:label_filter_plural) %>
+ </legend>
<div style="<%= @query.new_record? ? "" : "display: none;" %>">
<%= render :partial => 'queries/filters', :locals => {:query => @query} %>
</div>
<% if @query.available_columns.any? %>
<fieldset id="options" class="collapsible collapsed">
- <legend onclick="toggleFieldset(this);" class="icon icon-collapsed"><%= l(:label_options) %></legend>
+ <legend onclick="toggleFieldset(this);" class="icon icon-collapsed">
+ <%= sprite_icon("angle-right") %>
+ <%= l(:label_options) %>
+ </legend>
<div class="hidden">
<% if @query.available_display_types.size > 1 %>
<div>
:path => to_path_param(ent_path),
:rev => @rev,
:depth => (depth + 1),
- :parent_id => tr_id)) %>');"> </span>
+ :parent_id => tr_id)) %>');"><%= sprite_icon('angle-right') %></span>
<% end %>
<%= link_to icon_for_file(entry, ent_name),
{:action => (entry.is_dir? ? 'show' : 'entry'), :id => @project, :repository_id => @repository.identifier_param, :path => to_path_param(ent_path), :rev => @rev},
<div class="hide-when-print">
<fieldset id="filters" class="collapsible collapsed">
- <legend onclick="toggleFieldset(this);" class="icon icon-collapsed"><%= l(:label_filter_plural) %></legend>
+ <legend onclick="toggleFieldset(this);" class="icon icon-collapsed">
+ <%= sprite_icon("angle-right") %>
+ <%= l(:label_filter_plural) %>
+ </legend>
<div style="display: none;">
<%= form_tag({}, :method => :get) do %>
<fieldset>
<% unless mod.blank? %>
<tr class="group open">
<td>
- <span class="expander icon icon-expanded" onclick="toggleRowGroup(this);"> </span>
+ <span class="expander icon icon-expanded" onclick="toggleRowGroup(this);"><%= sprite_icon("angle-down") %></span>
<%= l_or_humanize(mod, :prefix => 'project_module_') %>
</td>
<% @roles.each do |role| %>
</fieldset>
<fieldset class="collapsible collapsed">
- <legend onclick="toggleFieldset(this);" class="icon icon-collapsed"><%= l(:label_options) %></legend>
+ <legend onclick="toggleFieldset(this);" class="icon icon-collapsed">
+ <%= sprite_icon("angle-right") %>
+ <%= l(:label_options) %>
+ </legend>
<div id="options-content" style="display:none;">
<p><label><%= check_box_tag 'open_issues', 1, @open_issues %> <%= l(:label_search_open_issues_only) %></label></p>
<p>
<% reset_cycle %>
<tr class="group open">
<td colspan="<%= @query.inline_columns.size + 2 %>">
- <span class="expander icon icon-expanded" onclick="toggleRowGroup(this);"> </span>
+ <span class="expander icon icon-expanded" onclick="toggleRowGroup(this);"><%= sprite_icon("angle-down") %></span>
<span class="name"><%= group_name %></span>
<% if group_count %>
<span class="badge badge-count count"><%= group_count %></span>
<tbody>
<tr class="group open">
<td colspan="<%= @trackers.size + 1 %>">
- <span class="expander icon icon-expanded" onclick="toggleRowGroup(this);"> </span>
+ <span class="expander icon icon-expanded" onclick="toggleRowGroup(this);"><%= sprite_icon("angle-down") %></span>
<%= l(:field_core_fields) %>
</td>
</tr>
<% if @custom_fields.any? %>
<tr class="group open">
<td colspan="<%= @trackers.size + 1 %>">
- <span class="expander icon icon-expanded" onclick="toggleRowGroup(this);"> </span>
+ <span class="expander icon icon-expanded" onclick="toggleRowGroup(this);"><%= sprite_icon("angle-down") %></span>
<%= l(:label_custom_field_plural) %>
</td>
</tr>
<% reset_cycle %>
<tr class="group open">
<td colspan="<%= @query.inline_columns.size + 2 %>">
- <span class="expander" onclick="toggleRowGroup(this);"> </span>
+ <span class="expander" onclick="toggleRowGroup(this);"><%= sprite_icon("angle-down") %></span>
<span class="name"><%= group_name %></span>
<% if group_count %>
<span class="count"><%= group_count %></span>
</ul>
<% if @completed_versions.present? %>
<p>
- <%= link_to_function l(:label_completed_versions),
+ <%= link_to_function icon_with_label('angle-right', l(:label_completed_versions)),
'$("#toggle-completed-versions").toggleClass("icon-collapsed icon-expanded"); $("#completed-versions").toggle()',
:id => 'toggle-completed-versions', :class => 'icon icon-collapsed collapsible' %>
<ul id = "completed-versions" style = "display:none;">
<%= render(:partial => "wiki/content", :locals => {:content => @content}) %>
<fieldset class="collapsible collapsed hide-when-print">
- <legend onclick="toggleFieldset(this);" class="icon icon-collapsed"><%= l(:label_attachment_plural) %> (<%= @page.attachments.length %>)</legend>
+ <legend onclick="toggleFieldset(this);" class="icon icon-collapsed">
+ <%= sprite_icon("angle-right") %>
+ <%= l(:label_attachment_plural) %> (<%= @page.attachments.length %>)
+ </legend>
<div style="display: none;">
<%= link_to_attachments @page, :thumbnails => true %>
<%= render :partial => 'form', :locals => {:name => 'always', :workflows => @workflows['always']} %>
<fieldset class="collapsible" style="padding: 0; margin-top: 0.5em;">
- <legend onclick="toggleFieldset(this);" class="icon icon-collapsed"><%= l(:label_additional_workflow_transitions_for_author) %></legend>
+ <legend onclick="toggleFieldset(this);" class="icon icon-collapsed">
+ <%= sprite_icon("angle-right") %>
+ <%= l(:label_additional_workflow_transitions_for_author) %>
+ </legend>
<div id="author_workflows" style="margin: 0.5em 0 0.5em 0;">
<%= render :partial => 'form', :locals => {:name => 'author', :workflows => @workflows['author']} %>
</div>
<%= javascript_tag "hideFieldset($('#author_workflows'))" unless @workflows['author'].present? %>
<fieldset class="collapsible" style="padding: 0;">
- <legend onclick="toggleFieldset(this);" class="icon icon-collapsed"><%= l(:label_additional_workflow_transitions_for_assignee) %></legend>
+ <legend onclick="toggleFieldset(this);" class="icon icon-collapsed">
+ <%= sprite_icon("angle-right") %>
+ <%= l(:label_additional_workflow_transitions_for_assignee) %>
+ </legend>
<div id="assignee_workflows" style="margin: 0.5em 0 0.5em 0;">
<%= render :partial => 'form', :locals => {:name => 'assignee', :workflows => @workflows['assignee']} %>
</div>
</div>
<%= submit_tag l(:button_save) %>
<% end %>
-<% end %>
\ No newline at end of file
+<% end %>
<tbody>
<tr class="group open">
<td colspan="<%= @statuses.size + 1 %>">
- <span class="expander icon icon-expanded" onclick="toggleRowGroup(this);"> </span>
+ <span class="expander icon icon-expanded" onclick="toggleRowGroup(this);"><%= sprite_icon("angle-down") %></span>
<%= l(:field_core_fields) %>
</td>
</tr>
<% if @custom_fields.any? %>
<tr class="group open">
<td colspan="<%= @statuses.size + 1 %>">
- <span class="expander icon icon-expanded" onclick="toggleRowGroup(this);"> </span>
+ <span class="expander icon icon-expanded" onclick="toggleRowGroup(this);"><%= sprite_icon("angle-down") %></span>
<%= l(:label_custom_field_plural) %>
</td>
</tr>
hide_label = args[1] || args[0] || l(:button_hide)
js = "$('##{html_id}-show, ##{html_id}-hide').toggle(); $('##{html_id}').fadeToggle(150);"
out = ''.html_safe
- out << link_to_function(show_label, js, :id => "#{html_id}-show", :class => 'icon icon-collapsed collapsible')
+ out << link_to_function(icon_with_label('angle-right', show_label), js, :id => "#{html_id}-show", :class => 'icon icon-collapsed collapsible')
out <<
link_to_function(
- hide_label, js,
+ icon_with_label('angle-down', hide_label), js,
:id => "#{html_id}-hide",
:class => 'icon icon-expanded collapsible',
:style => 'display:none;'