-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Experimenting with removing the theme js to see what happens when hos…
…ted on RTD [skip ci]
- Loading branch information
1 parent
6703e46
commit 35f1f9b
Showing
1 changed file
with
67 additions
and
67 deletions.
There are no files selected for viewing
134 changes: 67 additions & 67 deletions
134
support/docs/source/_themes/pixl8_rtd_theme/static/js/theme.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 ); |