Difference between revisions of "Template:Groningen"

Line 127: Line 127:
 
menuItems.removeClass('hover');
 
menuItems.removeClass('hover');
 
});
 
});
 +
}
 +
 +
function updateCollapseAll(){
 +
var img = $('#collapse-all img').first();
 +
 +
if(collapsers.open){
 +
img.attr('src', 'https://static.igem.org/mediawiki/2016/7/77/T--Groningen--minux.png');
 +
}else{
 +
img.attr('src', 'https://static.igem.org/mediawiki/2016/f/fa/T--Groningen--plus.png');
 +
}
 
}
 
}
 
 
Line 132: Line 142:
 
sec.addClass('hide');
 
sec.addClass('hide');
 
h.addClass('collapsed');
 
h.addClass('collapsed');
 +
 +
collapsers.open--;
 +
updateCollapseAll();
 
}
 
}
  
Line 139: Line 152:
 
sec.removeClass('hide');
 
sec.removeClass('hide');
 
h.removeClass('collapsed');
 
h.removeClass('collapsed');
 +
collapsers.open++;
 +
updateCollapseAll();
 
 
 
if(!rec){
 
if(!rec){
Line 213: Line 228:
 
collapsers.all.push({sec: sec, h: h});
 
collapsers.all.push({sec: sec, h: h});
 
 
if(!id || window.location.hash !== '#' + id){
+
hideOne(h, sec);
hideOne(h, sec);
+
}
+
 
});
 
});
 
}
 
}
 +
collapsers.closed = 0;
 +
collapsers.openedOne = false;
 
collapsers.allowConditional = false;
 
collapsers.allowConditional = false;
 
collapsers.allow = [];
 
collapsers.allow = [];
Line 228: Line 243:
 
 
 
collapsers.all.forEach(function(act){
 
collapsers.all.forEach(function(act){
hideOne(act.h, act.sec);
+
if(collapsers.open){
 +
hideOne(act.h, act.sec);
 +
}else{
 +
showOne(act.h, act.sec, true);
 +
}
 
});
 
});
 
 
Line 356: Line 375:
 
}
 
}
 
if(window.location.hash === '#top'){
 
if(window.location.hash === '#top'){
window.location.replace('#top');
+
window.location.replace('#');
 
}
 
}
 
}
 
}

Revision as of 15:58, 17 October 2016

CryptoGE®M
Team
Project
Biology
Computing
Human Practice
Acknowledgements