Line 128: | Line 128: | ||
function collapsers(hlvl){ | function collapsers(hlvl){ | ||
− | var secs = $('.collapse'+ (hlvl ? '-' + hlvl : '')) | + | var secs = $('.collapse'+ (hlvl ? '-' + hlvl : '')); |
− | + | ||
function hideOne(h, sec){ | function hideOne(h, sec){ | ||
Line 147: | Line 146: | ||
h.parents('collapsible').each(function(){ | h.parents('collapsible').each(function(){ | ||
var sec = $(this), h = $('#'+sec.data('the-h')); | var sec = $(this), h = $('#'+sec.data('the-h')); | ||
− | |||
showOne(h, sec); | showOne(h, sec); | ||
Line 206: | Line 204: | ||
sec.data('the-h', hid); | sec.data('the-h', hid); | ||
h.data('the-sec', secid); | h.data('the-sec', secid); | ||
− | + | collapsers.all.push({sec: sec, h: h}); | |
if(!id || window.location.hash !== '#' + id){ | if(!id || window.location.hash !== '#' + id){ | ||
Line 214: | Line 212: | ||
function toggleAll(){ | function toggleAll(){ | ||
− | + | collapsers.all.forEach(function(act){ | |
}); | }); | ||
} | } | ||
− | + | } | |
− | + | collapsers.allowConditional = false; | |
+ | collapsers.allow = []; | ||
+ | collapsers.all = []; | ||
+ | collapsers.nextId = 0; | ||
+ | |||
+ | function postcollapse(){ | ||
+ | if(collapsers.all.length){ | ||
+ | var wrap = $('#ayoop-wrapper'), | ||
+ | btn = $('<a href="#" id="collapser-all">⊖</a>'); | ||
+ | |||
+ | wrap.prepend(btn); | ||
+ | btn.click(toggleAll); | ||
+ | } | ||
if(window.location.hash.length > 1){ | if(window.location.hash.length > 1){ | ||
Line 237: | Line 247: | ||
showOne(h, sec); | showOne(h, sec); | ||
} | } | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
} | } | ||
} | } | ||
− | |||
− | |||
− | |||
− | |||
function memberate(){ | function memberate(){ | ||
Line 393: | Line 391: | ||
collapsers('h3'); | collapsers('h3'); | ||
collapsers('h4'); | collapsers('h4'); | ||
+ | postcollapse(); | ||
memberate(); | memberate(); | ||
cyclers(); | cyclers(); |
Revision as of 14:16, 17 October 2016