mobile nav javascript updated to still work with role='main-navigation' since changes affecting custom partials don't get updated with the standard update script

This commit is contained in:
Brandon Mathis 2011-09-25 09:14:50 -05:00
parent e7032f2f67
commit 9ef928588b

View File

@ -1,6 +1,7 @@
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] fieldset[role=search]').after('<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.main-navigation a').each(function(link) { $('ul.main-navigation a').each(function(link) {
mobileNav.children('select').append('<option value="'+link.href+'">&bull; '+link.text+'</option>'); mobileNav.children('select').append('<option value="'+link.href+'">&bull; '+link.text+'</option>');
}); });