2013-10-29 07:07:26 +08:00
|
|
|
$( document ).ready(function() {
|
2014-01-19 08:50:22 +08:00
|
|
|
// 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");
|
|
|
|
});
|
|
|
|
$(document).on('click', "[data-toggle='rst-current-version']", function() {
|
|
|
|
$("[data-toggle='rst-versions']").toggleClass("shift-up");
|
|
|
|
});
|
|
|
|
// Make tables responsive
|
|
|
|
$("table.docutils:not(.field-list)").wrap("<div class='wy-table-responsive'></div>");
|
2013-10-22 06:52:35 +08:00
|
|
|
});
|
2014-01-08 06:39:48 +08:00
|
|
|
|
|
|
|
window.SphinxRtdTheme = (function (jquery) {
|
|
|
|
var stickyNav = (function () {
|
|
|
|
var navBar,
|
|
|
|
win,
|
|
|
|
stickyNavCssClass = 'stickynav',
|
2014-06-12 00:30:56 +08:00
|
|
|
winScroll = false,
|
2014-01-08 06:39:48 +08:00
|
|
|
enable = function () {
|
2014-06-12 00:30:56 +08:00
|
|
|
navBar.addClass(stickyNavCssClass);
|
|
|
|
win.on('scroll', function() { // set flag on scroll event
|
|
|
|
winScroll = true;
|
|
|
|
});
|
|
|
|
// use setInterval to only handle a subset of scroll events so we don't kill scroll performance
|
|
|
|
setInterval(function() {
|
|
|
|
if (winScroll) {
|
|
|
|
winScroll = false;
|
|
|
|
navBar.scrollTop(win.scrollTop());
|
|
|
|
}
|
|
|
|
}, 100);
|
2014-01-08 06:39:48 +08:00
|
|
|
},
|
|
|
|
init = function () {
|
|
|
|
navBar = jquery('nav.wy-nav-side:first');
|
|
|
|
win = jquery(window);
|
|
|
|
};
|
|
|
|
jquery(init);
|
|
|
|
return {
|
|
|
|
enable : enable
|
|
|
|
};
|
|
|
|
}());
|
|
|
|
return {
|
|
|
|
StickyNav : stickyNav
|
|
|
|
};
|
2014-01-19 08:50:22 +08:00
|
|
|
}($));
|