Skip to content

Commit

Permalink
Experimenting with removing the theme js to see what happens when hos…
Browse files Browse the repository at this point in the history
…ted on RTD [skip ci]
  • Loading branch information
DominicWatson committed Jan 24, 2015
1 parent 6703e46 commit 35f1f9b
Showing 1 changed file with 67 additions and 67 deletions.
134 changes: 67 additions & 67 deletions support/docs/source/_themes/pixl8_rtd_theme/static/js/theme.js
Original file line number Diff line number Diff line change
@@ -1,77 +1,77 @@
$( document ).ready(function() {
// Shift nav in mobile when clicking the menu.
$(document).on('click', "[data-toggle='wy-nav-top']", function() {
$("[data-toggle='wy-nav-shift']").toggleClass("shift");
$("[data-toggle='rst-versions']").toggleClass("shift");
});
// Close menu when you click a link.
$(document).on('click', ".wy-menu-vertical .current ul li a", function() {
$("[data-toggle='wy-nav-shift']").removeClass("shift");
$("[data-toggle='rst-versions']").toggleClass("shift");
});
// Make tables responsive
$("table.docutils:not(.field-list)").wrap("<div class='wy-table-responsive'></div>");
// $( document ).ready(function() {
// // Shift nav in mobile when clicking the menu.
// $(document).on('click', "[data-toggle='wy-nav-top']", function() {
// $("[data-toggle='wy-nav-shift']").toggleClass("shift");
// $("[data-toggle='rst-versions']").toggleClass("shift");
// });
// // Close menu when you click a link.
// $(document).on('click', ".wy-menu-vertical .current ul li a", function() {
// $("[data-toggle='wy-nav-shift']").removeClass("shift");
// $("[data-toggle='rst-versions']").toggleClass("shift");
// });
// // Make tables responsive
// $("table.docutils:not(.field-list)").wrap("<div class='wy-table-responsive'></div>");

// crazy TOC hack
var $pageToc = $( '#page-toc' )
, $pageTitle = $pageToc.prev().find( "h1:first" );
// // crazy TOC hack
// var $pageToc = $( '#page-toc' )
// , $pageTitle = $pageToc.prev().find( "h1:first" );

$pageToc.insertAfter( $pageTitle );
});
// $pageToc.insertAfter( $pageTitle );
// });

window.SphinxRtdTheme = (function (jquery) {
var stickyNav = (function () {
var navBar,
win,
stickyNavCssClass = 'stickynav',
applyStickNav = function () {
if (navBar.height() <= win.height()) {
navBar.addClass(stickyNavCssClass);
} else {
navBar.removeClass(stickyNavCssClass);
}
},
enable = function () {
applyStickNav();
win.on('resize', applyStickNav);
},
init = function () {
navBar = jquery('nav.wy-nav-side:first');
win = jquery(window);
};
jquery(init);
return {
enable : enable
};
}());
return {
StickyNav : stickyNav
};
}($));
// window.SphinxRtdTheme = (function (jquery) {
// var stickyNav = (function () {
// var navBar,
// win,
// stickyNavCssClass = 'stickynav',
// applyStickNav = function () {
// if (navBar.height() <= win.height()) {
// navBar.addClass(stickyNavCssClass);
// } else {
// navBar.removeClass(stickyNavCssClass);
// }
// },
// enable = function () {
// applyStickNav();
// win.on('resize', applyStickNav);
// },
// init = function () {
// navBar = jquery('nav.wy-nav-side:first');
// win = jquery(window);
// };
// jquery(init);
// return {
// enable : enable
// };
// }());
// return {
// StickyNav : stickyNav
// };
// }($));

( function( $ ){
// ( function( $ ){

function scroll_if_anchor( href ) {
href = typeof(href) == "string" ? href : $(this).attr("href");
// function scroll_if_anchor( href ) {
// href = typeof(href) == "string" ? href : $(this).attr("href");

var fromTop = 65;
// var fromTop = 65;

if ( href.indexOf( "#" ) == 0 ) {
var $target = $(href);
// if ( href.indexOf( "#" ) == 0 ) {
// var $target = $(href);

if ( $target.length ) {
$('html, body').animate( { scrollTop: $target.offset().top - fromTop } );
if ( history && "pushState" in history ) {
history.pushState( {}, document.title, window.location.pathname + href );
return false;
}
}
}
}
// if ( $target.length ) {
// $('html, body').animate( { scrollTop: $target.offset().top - fromTop } );
// if ( history && "pushState" in history ) {
// history.pushState( {}, document.title, window.location.pathname + href );
// return false;
// }
// }
// }
// }

$( "body" ).on( "click", "a", scroll_if_anchor );
// $( "body" ).on( "click", "a", scroll_if_anchor );

$( function(){
scroll_if_anchor( window.location.hash );
} );
} )( jQuery );
// $( function(){
// scroll_if_anchor( window.location.hash );
// } );
// } )( jQuery );

0 comments on commit 35f1f9b

Please sign in to comment.