|
|
@ -162,42 +162,42 @@ function showAndScrollTo(id, focus) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function setGroupRowStatus(el) { |
|
|
|
function setGroupRowStatus(el) { |
|
|
|
var tr = jQuery(el).closest("tr"); |
|
|
|
var collapseExpandButton = jQuery(el); |
|
|
|
var isOpen = tr.hasClass("open") |
|
|
|
var row = jQuery(el).closest("tr"); |
|
|
|
var toggleButton = tr.find("img").first(); |
|
|
|
var isOpen = row.hasClass("open") |
|
|
|
var toggleButtonAltText = isOpen ? I18n.t('js.label_collapse') : I18n.t('js.label_expand'); |
|
|
|
var toggleAllLink = row.find(".toggle-all") |
|
|
|
var toggleButtonImage = isOpen ? "<%= asset_path 'bullet_toggle_minus.png' %>" : "<%= asset_path 'bullet_toggle_plus.png' %>"; |
|
|
|
|
|
|
|
var toggleAllLink = tr.find(".toggle-all") |
|
|
|
|
|
|
|
var toggleAllLinkText = isOpen ? I18n.t('js.label_collapse_all') : I18n.t('js.label_expand_all'); |
|
|
|
var toggleAllLinkText = isOpen ? I18n.t('js.label_collapse_all') : I18n.t('js.label_expand_all'); |
|
|
|
|
|
|
|
|
|
|
|
toggleButton.attr("alt", toggleButtonAltText); |
|
|
|
collapseExpandButton.toggleClass("icon-minus") |
|
|
|
toggleButton.attr("src", toggleButtonImage); |
|
|
|
collapseExpandButton.toggleClass("icon-plus") |
|
|
|
|
|
|
|
|
|
|
|
toggleAllLink.text(toggleAllLinkText); |
|
|
|
toggleAllLink.text(toggleAllLinkText); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function toggleRowGroup(el) { |
|
|
|
function toggleRowGroup(el) { |
|
|
|
var tr = jQuery(el).closest("tr"); |
|
|
|
var row = jQuery(el).closest("tr"); |
|
|
|
|
|
|
|
|
|
|
|
tr.toggleClass("open"); |
|
|
|
row.toggleClass("open closed"); |
|
|
|
|
|
|
|
|
|
|
|
setGroupRowStatus(el); |
|
|
|
setGroupRowStatus(el); |
|
|
|
|
|
|
|
|
|
|
|
tr.nextUntil("tr.group").each(function(index) { |
|
|
|
row.nextUntil("tr.group").each(function(index) { |
|
|
|
jQuery(this).toggle(); |
|
|
|
jQuery(this).toggle(); |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function toggleAllRowGroups(el) { |
|
|
|
function toggleAllRowGroups(el) { |
|
|
|
var tr = jQuery(el).closest("tr"); |
|
|
|
var row = jQuery(el).closest("tr"); |
|
|
|
var isOpen = tr.hasClass("open"); |
|
|
|
var collapseExpandButton = jQuery(row).find(".expander"); |
|
|
|
|
|
|
|
var isOpen = row.hasClass("open"); |
|
|
|
|
|
|
|
|
|
|
|
toggleRowGroup(el); |
|
|
|
toggleRowGroup(collapseExpandButton); |
|
|
|
|
|
|
|
|
|
|
|
tr.siblings("tr.group").each(function(index) { |
|
|
|
row.siblings("tr.group").each(function(index) { |
|
|
|
var currentGroupOpen = jQuery(this).hasClass("open"); |
|
|
|
var currentGroupOpen = jQuery(this).hasClass("open"); |
|
|
|
|
|
|
|
var collapseExpandButton = jQuery(this).find(".expander"); |
|
|
|
|
|
|
|
|
|
|
|
if (isOpen == currentGroupOpen) { |
|
|
|
if (isOpen == currentGroupOpen) { |
|
|
|
toggleRowGroup(this); |
|
|
|
toggleRowGroup(collapseExpandButton); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|