Last change
on this file since 828 was
659,
checked in by nbozon, 10 years ago
|
Massive update of zoo docs
|
-
Property svn:executable set to
*
|
File size:
1.8 KB
|
Line | |
---|
1 | $( document ).ready(function() { |
---|
2 | // Shift nav in mobile when clicking the menu. |
---|
3 | $(document).on('click', "[data-toggle='wy-nav-top']", function() { |
---|
4 | $("[data-toggle='wy-nav-shift']").toggleClass("shift"); |
---|
5 | $("[data-toggle='rst-versions']").toggleClass("shift"); |
---|
6 | }); |
---|
7 | // Close menu when you click a link. |
---|
8 | $(document).on('click', ".wy-menu-vertical .current ul li a", function() { |
---|
9 | $("[data-toggle='wy-nav-shift']").removeClass("shift"); |
---|
10 | $("[data-toggle='rst-versions']").toggleClass("shift"); |
---|
11 | }); |
---|
12 | $(document).on('click', "[data-toggle='rst-current-version']", function() { |
---|
13 | $("[data-toggle='rst-versions']").toggleClass("shift-up"); |
---|
14 | }); |
---|
15 | // Make tables responsive |
---|
16 | $("table.docutils:not(.field-list)").wrap("<div class='wy-table-responsive'></div>"); |
---|
17 | }); |
---|
18 | |
---|
19 | window.SphinxRtdTheme = (function (jquery) { |
---|
20 | var stickyNav = (function () { |
---|
21 | var navBar, |
---|
22 | win, |
---|
23 | stickyNavCssClass = 'stickynav', |
---|
24 | winScroll = false, |
---|
25 | enable = function () { |
---|
26 | navBar.addClass(stickyNavCssClass); |
---|
27 | win.on('scroll', function() { // set flag on scroll event |
---|
28 | winScroll = true; |
---|
29 | }); |
---|
30 | // use setInterval to only handle a subset of scroll events so we don't kill scroll performance |
---|
31 | setInterval(function() { |
---|
32 | if (winScroll) { |
---|
33 | winScroll = false; |
---|
34 | navBar.scrollTop(win.scrollTop()); |
---|
35 | } |
---|
36 | }, 100); |
---|
37 | }, |
---|
38 | init = function () { |
---|
39 | navBar = jquery('nav.wy-nav-side:first'); |
---|
40 | win = jquery(window); |
---|
41 | }; |
---|
42 | jquery(init); |
---|
43 | return { |
---|
44 | enable : enable |
---|
45 | }; |
---|
46 | }()); |
---|
47 | return { |
---|
48 | StickyNav : stickyNav |
---|
49 | }; |
---|
50 | }($)); |
---|
Note: See
TracBrowser
for help on using the repository browser.