Skip to content
Snippets Groups Projects
Commit d1b67be5 authored by khawkins98's avatar khawkins98
Browse files

Split EMBL selector content/functionality #70

parent 3b8e596e
No related branches found
No related tags found
No related merge requests found
...@@ -147,43 +147,11 @@ if (jQuery('body').hasClass('google-analytics-loaded')) { ...@@ -147,43 +147,11 @@ if (jQuery('body').hasClass('google-analytics-loaded')) {
$.fn.foundationExtendEBI = function() { $.fn.foundationExtendEBI = function() {
// Insert EMBL dropdown menu // Activate EMBL dropdown menu
(function insertEMBLdropdown() { (function activateEMBLdropdown() {
// the menu has already been added in script.js
try { try {
// remove any current dropdown
if ((elem=document.getElementById('embl-dropdown')) !== null) {
document.getElementById('embl-dropdown').remove();
}
// document.getElementById('embl-dropdown').innerHTML = '';
var dropdownDiv = document.createElement("div");
dropdownDiv.innerHTML = '<div id="embl-dropdown" class="dropdown-pane bottom" data-dropdown>' +
'<p>EMBL-EBI in Hinxton is one of five EMBL locations across europe.<br/> <a href="//www.ebi.ac.uk/about" class="small readmore">More about EMBL-EBI</a></p>' +
'<h6>Connect to another EMBL location</h6>' +
'<div class="small-collapse small-up-2 padding-bottom-large clearfix">' +
'<div class="column padding-bottom-medium">' +
'<a href="http://www.embl.fr/" class="">Grenoble</a>' +
'<div class="small">Structural Biology</div>' +
'</div>' +
'<div class="column padding-bottom-medium">' +
'<a href="http://www.embl-hamburg.de/" class="">Hamburg</a>' +
'<div class="small">Structural Biology</div>' +
'</div>' +
'<div class="column padding-bottom-medium">' +
'<a href="http://www.embl.de/" class="">Heidelberg</a>' +
'<div class="small">Main Laboratory</div>' +
'</div>' +
'<div class="column padding-bottom-medium">' +
'<a href="http://www.embl.it/" class="">Monterotondo</a>' +
'<div class="small">Mouse Biology</div>' +
'</div>' +
'</div>' +
'<p><a href="http://embl.org/" class="button readmore">Or learn more about EMBL</a></p>' +
'</div>';
document.getElementById("global-masthead").appendChild(dropdownDiv);
// invoke the the foundation dropdown
var options = {closeOnClick: true}, var options = {closeOnClick: true},
dropdownEbiMenu = new Foundation.Dropdown($('#embl-dropdown'), options); dropdownEbiMenu = new Foundation.Dropdown($('#embl-dropdown'), options);
} }
...@@ -210,6 +178,7 @@ if (jQuery('body').hasClass('google-analytics-loaded')) { ...@@ -210,6 +178,7 @@ if (jQuery('body').hasClass('google-analytics-loaded')) {
}); });
// Responsive support for tables // Responsive support for tables
// ---------
// Clone the class from a parent TH to any child TD // Clone the class from a parent TH to any child TD
$('table.responsive-table').each( function() { $('table.responsive-table').each( function() {
var columnsToAppend = $(this).find('th'); var columnsToAppend = $(this).find('th');
...@@ -287,7 +256,7 @@ if (jQuery('body').hasClass('google-analytics-loaded')) { ...@@ -287,7 +256,7 @@ if (jQuery('body').hasClass('google-analytics-loaded')) {
// Do we need to make space? // Do we need to make space?
if ( (changeDirection == 'init') || (changeDirection == 'decrease') ) { if ( (changeDirection == 'init') || (changeDirection == 'decrease') ) {
if (localMenuWidthUsed > localMenuWidthAvail) { if (localMenuWidthUsed > localMenuWidthAvail) {
// show dropdown, if hidden // show dropdown, if hidden
if ($(localMenuClass + ' li.extra-items-menu:visible').length == 0) { if ($(localMenuClass + ' li.extra-items-menu:visible').length == 0) {
$(localMenuClass + ' li.extra-items-menu').show(); $(localMenuClass + ' li.extra-items-menu').show();
} }
......
...@@ -216,5 +216,45 @@ ...@@ -216,5 +216,45 @@
localMasthead.className += ' meta-background-image'; localMasthead.className += ' meta-background-image';
} }
})(); })();
// Insert EMBL dropdown menu
(function insertEMBLdropdown() {
try {
// remove any current dropdown
if ((elem=document.getElementById('embl-dropdown')) !== null) {
document.getElementById('embl-dropdown').remove();
}
var dropdownDiv = document.createElement("div");
dropdownDiv.innerHTML = '<div id="embl-dropdown" class="dropdown-pane bottom" data-dropdown>' +
'<p>EMBL-EBI in Hinxton is one of five EMBL locations across europe.<br/> <a href="//www.ebi.ac.uk/about" class="small readmore">More about EMBL-EBI</a></p>' +
'<h6>Connect to another EMBL location</h6>' +
'<div class="small-collapse small-up-2 padding-bottom-large clearfix">' +
'<div class="column padding-bottom-medium">' +
'<a href="http://www.embl.fr/" class="">Grenoble</a>' +
'<div class="small">Structural Biology</div>' +
'</div>' +
'<div class="column padding-bottom-medium">' +
'<a href="http://www.embl-hamburg.de/" class="">Hamburg</a>' +
'<div class="small">Structural Biology</div>' +
'</div>' +
'<div class="column padding-bottom-medium">' +
'<a href="http://www.embl.de/" class="">Heidelberg</a>' +
'<div class="small">Main Laboratory</div>' +
'</div>' +
'<div class="column padding-bottom-medium">' +
'<a href="http://www.embl.it/" class="">Monterotondo</a>' +
'<div class="small">Mouse Biology</div>' +
'</div>' +
'</div>' +
'<p><a href="http://embl.org/" class="button readmore">Or learn more about EMBL</a></p>' +
'</div>';
document.getElementById("global-masthead").appendChild(dropdownDiv);
// We don't invoke the dropdown here, as that method depends on how you're using the Framework
}
catch(err) {};
})();
})(); })();
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment