File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change 76
76
setCookie ( selectedSkinBackgroundColorKey , backgroundColor ) ;
77
77
} ;
78
78
79
- function toggleIcon ( target , off ) {
80
- if ( off ) {
79
+ function setIcon ( target , isOff ) {
80
+ if ( isOff ) {
81
81
target . classList . remove ( 'fa-toggle-on' ) ;
82
82
target . classList . add ( 'fa-toggle-off' ) ;
83
83
}
91
91
var off = getSkinModeState ( ) == darkModeStateOff ;
92
92
93
93
setSkinModeState ( off ? darkModeStateOn : darkModeStateOff ) ;
94
- toggleIcon ( event . target , off ) ;
94
+ setIcon ( event . target , off == false ) ;
95
95
96
96
event . currentTarget . blur ( ) ;
97
97
}
107
107
// Why this is not working?!?!
108
108
//document.body.style.removeProperty("backgroundColor");
109
109
document . body . style . backgroundColor = "" ;
110
-
111
- toggleIcon ( $ ( '#skin-button' ) . find ( '.masthead_button_icon' ) [ 0 ] , getSkinModeState ( ) ) ;
110
+
111
+ var currSkinModeState = getSkinModeState ( ) ;
112
+ setIcon ( $ ( '#skin-button' ) . find ( '.masthead_button_icon' ) [ 0 ] , currSkinModeState == darkModeStateOff ) ;
113
+
112
114
$ ( "#skin-button" ) . on ( "click" , toggleSkin ) ;
113
115
114
116
// TODO: See, setSkinModeState - stylesheet.onload
You can’t perform that action at this time.
0 commit comments