File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -94,7 +94,8 @@ const Sidebar = (($) => {
94
94
95
95
perfectScrollbar ( event ) {
96
96
if ( typeof PerfectScrollbar !== 'undefined' ) {
97
- if ( event === Event . INIT && ! document . body . classList . contains ( ClassName . SIDEBAR_MINIMIZED ) ) {
97
+ const classList = document . body . classList
98
+ if ( event === Event . INIT && ! classList . contains ( ClassName . SIDEBAR_MINIMIZED ) ) {
98
99
this . ps = this . makeScrollbar ( )
99
100
}
100
101
@@ -103,14 +104,15 @@ const Sidebar = (($) => {
103
104
}
104
105
105
106
if ( event === Event . TOGGLE ) {
106
- if ( document . body . classList . contains ( ClassName . SIDEBAR_MINIMIZED ) ) {
107
+ if ( classList . contains ( ClassName . SIDEBAR_MINIMIZED ) ) {
107
108
this . destroyScrollbar ( )
108
109
} else {
110
+ this . destroyScrollbar ( )
109
111
this . ps = this . makeScrollbar ( )
110
112
}
111
113
}
112
114
113
- if ( event === Event . UPDATE && ! document . body . classList . contains ( ClassName . SIDEBAR_MINIMIZED ) ) {
115
+ if ( event === Event . UPDATE && ! classList . contains ( ClassName . SIDEBAR_MINIMIZED ) ) {
114
116
// ToDo: Add smooth transition
115
117
setTimeout ( ( ) => {
116
118
this . destroyScrollbar ( )
You can’t perform that action at this time.
0 commit comments