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 = (($) => {
9494
9595 perfectScrollbar ( event ) {
9696 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 ) ) {
9899 this . ps = this . makeScrollbar ( )
99100 }
100101
@@ -103,14 +104,15 @@ const Sidebar = (($) => {
103104 }
104105
105106 if ( event === Event . TOGGLE ) {
106- if ( document . body . classList . contains ( ClassName . SIDEBAR_MINIMIZED ) ) {
107+ if ( classList . contains ( ClassName . SIDEBAR_MINIMIZED ) ) {
107108 this . destroyScrollbar ( )
108109 } else {
110+ this . destroyScrollbar ( )
109111 this . ps = this . makeScrollbar ( )
110112 }
111113 }
112114
113- if ( event === Event . UPDATE && ! document . body . classList . contains ( ClassName . SIDEBAR_MINIMIZED ) ) {
115+ if ( event === Event . UPDATE && ! classList . contains ( ClassName . SIDEBAR_MINIMIZED ) ) {
114116 // ToDo: Add smooth transition
115117 setTimeout ( ( ) => {
116118 this . destroyScrollbar ( )
You can’t perform that action at this time.
0 commit comments