summaryrefslogtreecommitdiffstats
path: root/user_guide_src/source/_themes
diff options
context:
space:
mode:
authorInstructor, BCIT <jim_parry@bcit.ca>2019-04-23 18:10:15 +0200
committerGitHub <noreply@github.com>2019-04-23 18:10:15 +0200
commit378ed67dbfc831b71c0fa9d6c5de44e401f4ff26 (patch)
tree89fc9fb607038c08c5367276f5dc9a53a69c25a4 /user_guide_src/source/_themes
parenta2a46376d19ce7c9dc2d0c0797b7740b1160af5b (diff)
parenta9a87684ed953c41a6ac966f3253163a775e211d (diff)
Merge pull request #5453 from popcorner/popcorner-toc
[user guide] replace toggle() to fix the toc button
Diffstat (limited to 'user_guide_src/source/_themes')
-rw-r--r--user_guide_src/source/_themes/sphinx_rtd_theme/static/js/theme.js29
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 ---