@@ -25,7 +25,7 @@ $(document).ready(function () {
25
25
$ ( '#closeMe' ) . toggle (
26
26
function ( )
27
27
{
28
- setCookie ( 'ciNav' , 'true ' , 365 ) ;
28
+ setCookie ( 'ciNav' , 'yes ' , 365 ) ;
29
29
$ ( '#nav2' ) . show ( ) ;
30
30
$ ( '#topMenu' ) . remove ( ) ;
31
31
$ ( 'body' ) . css ( { background : 'none' } ) ;
@@ -35,7 +35,7 @@ $(document).ready(function () {
35
35
} ,
36
36
function ( )
37
37
{
38
- setCookie ( 'ciNav' , 'false ' , 365 ) ;
38
+ setCookie ( 'ciNav' , 'no ' , 365 ) ;
39
39
$ ( '#topMenu' ) . remove ( ) ;
40
40
$ ( '#nav' ) . hide ( ) ;
41
41
$ ( '#nav2' ) . hide ( ) ;
@@ -44,7 +44,7 @@ $(document).ready(function () {
44
44
$ ( '.wy-nav-side' ) . show ( ) ;
45
45
}
46
46
) ;
47
- if ( getCookie ( 'ciNav' ) == 'true ' )
47
+ if ( getCookie ( 'ciNav' ) == 'yes ' )
48
48
{
49
49
$ ( '#closeMe' ) . trigger ( 'click' ) ;
50
50
//$('#nav').slideToggle();
@@ -56,7 +56,7 @@ $(document).ready(function () {
56
56
// Rufnex Cookie functions
57
57
function setCookie ( cname , cvalue , exdays ) {
58
58
// expire the old cookie if existed to avoid multiple cookies with the same name
59
- if ( getCookie ( cname ) != false ) {
59
+ if ( getCookie ( cname ) ) {
60
60
document . cookie = cname + "=;expires=Thu, 01 Jan 1970 00:00:00 GMT" ;
61
61
}
62
62
var d = new Date ( ) ;
@@ -75,27 +75,27 @@ function getCookie(cname) {
75
75
return c . substring ( name . length , c . length ) ;
76
76
}
77
77
}
78
- return false ;
78
+ return '' ;
79
79
}
80
80
// End
81
81
82
82
// resize window
83
83
$ ( window ) . on ( 'resize' , function ( ) {
84
84
// show side nav on small screens when pulldown is enabled
85
- if ( getCookie ( 'ciNav' ) == 'true ' && $ ( window ) . width ( ) <= 768 ) { // 768px is the tablet size defined by the theme
85
+ if ( getCookie ( 'ciNav' ) == 'yes ' && $ ( window ) . width ( ) <= 768 ) { // 768px is the tablet size defined by the theme
86
86
$ ( '.wy-nav-side' ) . show ( ) ;
87
87
}
88
88
// changing css with jquery seems to override the default css media query
89
89
// change margin
90
- else if ( getCookie ( 'ciNav' ) == 'false ' && $ ( window ) . width ( ) <= 768 ) {
90
+ else if ( getCookie ( 'ciNav' ) == 'no ' && $ ( window ) . width ( ) <= 768 ) {
91
91
$ ( '.wy-nav-content-wrap' ) . css ( { 'margin-left' : 0 } ) ;
92
92
}
93
93
// hide side nav on large screens when pulldown is enabled
94
- else if ( getCookie ( 'ciNav' ) == 'true ' && $ ( window ) . width ( ) > 768 ) {
94
+ else if ( getCookie ( 'ciNav' ) == 'yes ' && $ ( window ) . width ( ) > 768 ) {
95
95
$ ( '.wy-nav-side' ) . hide ( ) ;
96
96
}
97
97
// change margin
98
- else if ( getCookie ( 'ciNav' ) == 'false ' && $ ( window ) . width ( ) > 768 ) {
98
+ else if ( getCookie ( 'ciNav' ) == 'no ' && $ ( window ) . width ( ) > 768 ) {
99
99
$ ( '.wy-nav-content-wrap' ) . css ( { 'margin-left' : '300px' } ) ;
100
100
}
101
101
} ) ;
0 commit comments