diff options
author | jim <jim@localhost> | 2015-02-04 23:23:33 +0100 |
---|---|---|
committer | jim <jim@localhost> | 2015-02-04 23:23:33 +0100 |
commit | 7efcd706711712cc3ac5250d820aa7100a16901e (patch) | |
tree | ab2d3bcf6398c7bc680c75eb6fa2bb1a1c76e3c7 /user_guide_src/source/_themes/sphinx_rtd_theme/static/js/oldtheme.js | |
parent | eccac6e6a73a4d1a5b40f383ce64359c2c94ae12 (diff) |
Add pulldown menu to user guide.
Integrating Rufnex's Javascript optional menu replacement :)
Now you will see a small icon in the top right of the user guide browser window. Clicking this toggles between the readdocs style TOC, in the left sidebar, and the "classic" CI TOC, a pulldown activated by clicking on the "Table of Contents" icon at the top of the browser window. The tool use a cookie to remember your decision.
Integrated on behalf of .... -- Have fun! Rufnex - codeigniter.de
Diffstat (limited to 'user_guide_src/source/_themes/sphinx_rtd_theme/static/js/oldtheme.js')
-rw-r--r-- | user_guide_src/source/_themes/sphinx_rtd_theme/static/js/oldtheme.js | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/user_guide_src/source/_themes/sphinx_rtd_theme/static/js/oldtheme.js b/user_guide_src/source/_themes/sphinx_rtd_theme/static/js/oldtheme.js new file mode 100644 index 000000000..60520cc3a --- /dev/null +++ b/user_guide_src/source/_themes/sphinx_rtd_theme/static/js/oldtheme.js @@ -0,0 +1,47 @@ +$( 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"); + }); + $(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>"); +}); + +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 + }; +}($)); |