diff options
author | popcorner <memoword@163.com> | 2018-03-28 13:17:40 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-28 13:17:40 +0200 |
commit | a9a87684ed953c41a6ac966f3253163a775e211d (patch) | |
tree | ee758d089c2f7bd33ec03bd78623b7ea065c7e61 /user_guide_src | |
parent | c243df3af851fe90cd272f3958f7eb7bf76173b1 (diff) |
replace toggle() to fix the toc button
Diffstat (limited to 'user_guide_src')
-rw-r--r-- | user_guide_src/source/_themes/sphinx_rtd_theme/static/js/theme.js | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/user_guide_src/source/_themes/sphinx_rtd_theme/static/js/theme.js b/user_guide_src/source/_themes/sphinx_rtd_theme/static/js/theme.js index 081d77bdf..911dad29b 100644 --- a/user_guide_src/source/_themes/sphinx_rtd_theme/static/js/theme.js +++ b/user_guide_src/source/_themes/sphinx_rtd_theme/static/js/theme.js @@ -22,31 +22,34 @@ $(document).ready(function () { $('#openToc').click(function () { $('#nav').slideToggle(); }); - $('#closeMe').toggle( - function () - { + $('#closeMe').click(function () { + if (getCookie('ciNav') != 'yes') { setCookie('ciNav', 'yes', 365); + } else { + setCookie('ciNav', 'no', 365); + } + tocFlip(); + }); + var tocFlip = function(){ + if (getCookie('ciNav') == 'yes') { $('#nav2').show(); $('#topMenu').remove(); - $('body').css({background: 'none'}); - $('.wy-nav-content-wrap').css({background: 'none', 'margin-left': 0}); + $('body').css({ background: 'none' }); + $('.wy-nav-content-wrap').css({ background: 'none', 'margin-left': 0 }); $('.wy-breadcrumbs').append('<div style="float:right;"><div style="float:left;" id="topMenu">' + $('.wy-form').parent().html() + '</div></div>'); $('.wy-nav-side').toggle(); - }, - function () - { - setCookie('ciNav', 'no', 365); + } else { $('#topMenu').remove(); $('#nav').hide(); $('#nav2').hide(); - $('body').css({background: '#edf0f2;'}); - $('.wy-nav-content-wrap').css({background: 'none repeat scroll 0 0 #fcfcfc;', 'margin-left': '300px'}); + $('body').css({ background: '#edf0f2;' }); + $('.wy-nav-content-wrap').css({ background: 'none repeat scroll 0 0 #fcfcfc;', 'margin-left': '300px' }); $('.wy-nav-side').show(); } - ); + }; if (getCookie('ciNav') == 'yes') { - $('#closeMe').trigger('click'); + tocFlip(); //$('#nav').slideToggle(); } // END MODIFICATION --- |