mirror of
https://github.com/moparisthebest/android.moparisthebest.org
synced 2024-12-25 08:58:58 -05:00
Mobile nav fixed for better IE support. Closes #595
This commit is contained in:
parent
43850a2456
commit
f38ed3ce8d
@ -1,15 +1,14 @@
|
|||||||
var octopress = (function(){
|
var octopress = (function(){
|
||||||
return {
|
return {
|
||||||
getNav: function() {
|
addMobileNav: function () {
|
||||||
var mainNav = $('ul.main-navigation, ul[role=main-navigation]').before('<fieldset class="mobile-nav">')
|
var mainNav = $('ul.main-navigation, ul[role=main-navigation]').before('<fieldset class="mobile-nav">')
|
||||||
var mobileNav = $('fieldset.mobile-nav').append('<select>');
|
var mobileNav = $('fieldset.mobile-nav').append('<select>');
|
||||||
mobileNav.find('select').append('<option value="">Navigate…</option>');
|
mobileNav.find('select').append('<option value="">Navigate…</option>');
|
||||||
mainNav.find('a').each(function() {
|
var addOption = function() {
|
||||||
mobileNav.find('select').append('<option value="'+this.href+'">» '+this.text+'</option>');
|
mobileNav.find('select').append('<option value="' + this.href + '">» ' + $(this).text() + '</option>');
|
||||||
});
|
}
|
||||||
$('ul.subscription a').each(function() {
|
mainNav.find('a').each(addOption);
|
||||||
mobileNav.find('select').append('<option value="'+this.href+'">» '+this.text+'</option>');
|
$('ul.subscription a').each(addOption);
|
||||||
});
|
|
||||||
mobileNav.find('select').bind('change', function(event) {
|
mobileNav.find('select').bind('change', function(event) {
|
||||||
if (event.target.value) { window.location.href = event.target.value; }
|
if (event.target.value) { window.location.href = event.target.value; }
|
||||||
});
|
});
|
||||||
@ -248,7 +247,7 @@ $(document).ready(function() {
|
|||||||
octopress.testFeatures();
|
octopress.testFeatures();
|
||||||
octopress.flashVideoFallback();
|
octopress.flashVideoFallback();
|
||||||
octopress.addCodeLineNumbers();
|
octopress.addCodeLineNumbers();
|
||||||
octopress.getNav();
|
octopress.addMobileNav();
|
||||||
octopress.addSidebarToggler();
|
octopress.addSidebarToggler();
|
||||||
octopress.twitter.getFeed('#tweets')
|
octopress.twitter.getFeed('#tweets')
|
||||||
octopress.github.showRepos('#gh_repos');
|
octopress.github.showRepos('#gh_repos');
|
||||||
|
Loading…
Reference in New Issue
Block a user