Improved mobile navigation injection script to work when search is not present. Fixes #380

This commit is contained in:
Brandon Mathis 2012-05-22 21:18:55 -05:00
parent 934e3b3040
commit 47573af6c6

View File

@ -1,5 +1,5 @@
function getNav() { function getNav() {
var mobileNav = $('nav[role=navigation] fieldset[role=search]').after('<fieldset class="mobile-nav"></fieldset>').next().append('<select></select>'); var mobileNav = $('nav[role=navigation] ul.main-navigation').before('<fieldset class="mobile-nav"></fieldset>').next().append('<select></select>');
mobileNav.children('select').append('<option value="">Navigate&hellip;</option>'); mobileNav.children('select').append('<option value="">Navigate&hellip;</option>');
$('ul[role=main-navigation]').addClass('main-navigation'); $('ul[role=main-navigation]').addClass('main-navigation');
$('ul.main-navigation a').each(function(link) { $('ul.main-navigation a').each(function(link) {