Difference between revisions of "Template:Groningen"

Line 125: Line 125:
 
menuItems.removeClass('hover');
 
menuItems.removeClass('hover');
 
});
 
});
 +
}
 +
 +
function hideOne(h, sec){
 +
sec.addClass('hide');
 +
h.addClass('collapsed');
 
}
 
}
  
function collapsers(hlvl){
+
function showOne(h, sec){
var secs = $('.collapse'+ (hlvl ? '-' + hlvl : ''));
+
var id = h.attr('id');
 
 
function hideOne(h, sec){
+
sec.removeClass('hide');
sec.addClass('hide');
+
h.removeClass('collapsed');
h.addClass('collapsed');
+
 +
if(id){
 +
window.location.hash = '#'+id;
 
}
 
}
 
 
function showOne(h, sec){
+
h.parents('collapser').each(function(){
var id = h.attr('id');
+
var h = $(this), sec = $('#sec-'+h.attr('id'));
sec.removeClass('hide');
+
h.removeClass('collapsed');
+
 
 
if(id){
+
showOne(h, sec);
window.location.hash = '#'+id;
+
});
}
+
}
+
 
h.parents('collapsible').each(function(){
+
function collapsers(hlvl){
var sec = $(this), h = $('#'+sec.data('the-h'));
+
var secs = $('.collapse'+ (hlvl ? '-' + hlvl : ''));
+
showOne(h, sec);
+
});
+
}
+
 
 
 
function toggleOne(h, sec){
 
function toggleOne(h, sec){
Line 205: Line 206:
 
});
 
});
 
h.addClass('collapser');
 
h.addClass('collapser');
sec.addClass('collapsible');
 
sec.data('the-h', hid);
 
h.data('the-sec', secid);
 
 
collapsers.all.push({sec: sec, h: h});
 
collapsers.all.push({sec: sec, h: h});
 
 
Line 236: Line 234:
 
 
 
if(window.location.hash.length > 1){
 
if(window.location.hash.length > 1){
var elm = $(window.location.hash).first(),
+
var h = $(window.location.hash), sec;
h, sec;
+
 
 
if(elm.length){
+
if(!h.length){
h = elm.data('the-h');
+
return;
if(h){
+
h = $('#'+h);
+
sec = elm;
+
}else{
+
h = elm;
+
sec = $('#'+elm.data('the-sec'));
+
}
+
+
showOne(h, sec);
+
 
}
 
}
 +
 +
sec = $('#sec-'+h.attr('id'));
 +
 +
showOne(h, sec);
 
}
 
}
 
}
 
}

Revision as of 14:25, 17 October 2016

CryptoGE®M
Team
Project
Biology
Computing
Human Practice
Acknowledgements