Skip to content
Snippets Groups Projects
Commit 919fc1f4 authored by Konstantinos Platis's avatar Konstantinos Platis
Browse files

Fixes issue with active trail in the 2nd level of menu

parent 43472a59
No related branches found
No related tags found
1 merge request!32Release candidate for version 2.5.0
...@@ -103,17 +103,20 @@ ...@@ -103,17 +103,20 @@
if (("/"+currentlang) == previous_path) { if (("/"+currentlang) == previous_path) {
break; break;
} }
matched_links = $('li.cern-dropdown').find('a[href^="'+ previous_path +'"]');
if ((matched_links.length > 1 && current_search != '') || matched_links.length == 1) { matched_links = jQuery('li.cern-dropdown').find('a[href^="'+ previous_path +'"]');
if ((matched_links.length > 1 && current_search != '') || matched_links.length == 1) {
jQuery('li.cern-dropdown').find('a[href^="'+ previous_path + current_search + '"]').closest('.cern-submenu').find('.cernmenu-level-0 a').addClass('active-trail');
jQuery('li.cern-dropdown').find('a[href^="'+ previous_path + current_search + '"]').addClass('active-trail');
break; break;
} else {
if (i==0) {
matched_links.closest('.cern-submenu').find('.cernmenu-level-0 a').addClass('active-trail');
}
} }
current_path.pop(); current_path.pop();
} }
/*if (matched_links.length > 1 && current_search != '') {
var matched_links = $('li.cern-dropdown').find('a[href^="'+ previous_path + current_search +'"]');
}*/
if (matched_links.length == 1) { if (matched_links.length == 1) {
// make a row children link active // make a row children link active
matched_links.eq(0).addClass('active-trail'); matched_links.eq(0).addClass('active-trail');
...@@ -124,7 +127,6 @@ ...@@ -124,7 +127,6 @@
matched_links.eq(0).closest('.cern-dropdown').find('a.dropdown-toggle').eq(0).addClass('active-trail'); matched_links.eq(0).closest('.cern-dropdown').find('a.dropdown-toggle').eq(0).addClass('active-trail');
} }
} }
/** END ACTIVE TRAIL */ /** END ACTIVE TRAIL */
})(jQuery, Drupal); })(jQuery, Drupal);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment