|
|
@ -161,45 +161,45 @@ function showAndScrollTo(id, focus) { |
|
|
|
Element.scrollTo(id); |
|
|
|
Element.scrollTo(id); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function toggleRowGroup(el) { |
|
|
|
function setGroupRowStatus(el) { |
|
|
|
var tr = Element.up(el, 'tr'); |
|
|
|
var collapseExpandButton = jQuery(el); |
|
|
|
var n = Element.next(tr); |
|
|
|
var row = jQuery(el).closest("tr"); |
|
|
|
tr.toggleClassName('open'); |
|
|
|
var isOpen = row.hasClass("open") |
|
|
|
while (n != undefined && !n.hasClassName('group')) { |
|
|
|
var toggleAllLink = row.find(".toggle-all") |
|
|
|
Element.toggle(n); |
|
|
|
var toggleAllLinkText = isOpen ? I18n.t('js.label_collapse_all') : I18n.t('js.label_expand_all'); |
|
|
|
n = Element.next(n); |
|
|
|
|
|
|
|
} |
|
|
|
collapseExpandButton.toggleClass("icon-minus") |
|
|
|
|
|
|
|
collapseExpandButton.toggleClass("icon-plus") |
|
|
|
|
|
|
|
toggleAllLink.text(toggleAllLinkText); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function collapseAllRowGroups(el) { |
|
|
|
function toggleRowGroup(el) { |
|
|
|
var tbody = Element.up(el, 'tbody'); |
|
|
|
var row = jQuery(el).closest("tr"); |
|
|
|
tbody.childElements('tr').each(function(tr) { |
|
|
|
|
|
|
|
if (tr.hasClassName('group')) { |
|
|
|
row.toggleClass("open closed"); |
|
|
|
tr.removeClassName('open'); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
tr.hide(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function expandAllRowGroups(el) { |
|
|
|
setGroupRowStatus(el); |
|
|
|
var tbody = Element.up(el, 'tbody'); |
|
|
|
|
|
|
|
tbody.childElements('tr').each(function(tr) { |
|
|
|
row.nextUntil("tr.group").each(function(index) { |
|
|
|
if (tr.hasClassName('group')) { |
|
|
|
jQuery(this).toggle(); |
|
|
|
tr.addClassName('open'); |
|
|
|
}); |
|
|
|
} else { |
|
|
|
|
|
|
|
tr.show(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function toggleAllRowGroups(el) { |
|
|
|
function toggleAllRowGroups(el) { |
|
|
|
var tr = Element.up(el, 'tr'); |
|
|
|
var row = jQuery(el).closest("tr"); |
|
|
|
if (tr.hasClassName('open')) { |
|
|
|
var collapseExpandButton = jQuery(row).find(".expander"); |
|
|
|
collapseAllRowGroups(el); |
|
|
|
var isOpen = row.hasClass("open"); |
|
|
|
} else { |
|
|
|
|
|
|
|
expandAllRowGroups(el); |
|
|
|
toggleRowGroup(collapseExpandButton); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
row.siblings("tr.group").each(function(index) { |
|
|
|
|
|
|
|
var currentGroupOpen = jQuery(this).hasClass("open"); |
|
|
|
|
|
|
|
var collapseExpandButton = jQuery(this).find(".expander"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (isOpen == currentGroupOpen) { |
|
|
|
|
|
|
|
toggleRowGroup(collapseExpandButton); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function toggleFieldset(el) { |
|
|
|
function toggleFieldset(el) { |