@@ -38,7 +38,6 @@ const DefaultType = {
38
38
39
39
const CLASS_NAME_BACKDROP = 'sidebar-backdrop'
40
40
const CLASS_NAME_FADE = 'fade'
41
- // const CLASS_NAME_HIDE = 'hide'
42
41
const CLASS_NAME_SHOW = 'show'
43
42
const CLASS_NAME_SIDEBAR = 'sidebar'
44
43
const CLASS_NAME_SIDEBAR_NARROW = 'sidebar-narrow'
@@ -69,7 +68,6 @@ class Sidebar extends BaseComponent {
69
68
constructor ( element , config ) {
70
69
super ( element )
71
70
this . _config = this . _getConfig ( config )
72
- // this._breakpoint = this._getBreakpoint()
73
71
this . _show = this . _isVisible ( )
74
72
this . _mobile = this . _isMobile ( )
75
73
this . _overlaid = this . _isOverlaid ( )
@@ -96,10 +94,6 @@ class Sidebar extends BaseComponent {
96
94
show ( ) {
97
95
EventHandler . trigger ( this . _element , EVENT_SHOW )
98
96
99
- // if (this._element.classList.contains(CLASS_NAME_HIDE)) {
100
- // this._element.classList.remove(CLASS_NAME_HIDE)
101
- // }
102
-
103
97
if ( REGEXP_SIDEBAR_SELF_HIDING . test ( this . _element . className ) ) {
104
98
this . _element . classList . add ( CLASS_NAME_SHOW )
105
99
}
@@ -132,8 +126,6 @@ class Sidebar extends BaseComponent {
132
126
this . _element . classList . remove ( CLASS_NAME_SHOW )
133
127
}
134
128
135
- // this._element.classList.add(CLASS_NAME_HIDE)
136
-
137
129
if ( this . _isMobile ( ) ) {
138
130
this . _removeBackdrop ( )
139
131
}
@@ -156,7 +148,7 @@ class Sidebar extends BaseComponent {
156
148
}
157
149
158
150
toggle ( ) {
159
- if ( this . _show ) {
151
+ if ( this . _isVisible ( ) ) {
160
152
this . hide ( )
161
153
return
162
154
}
@@ -240,29 +232,6 @@ class Sidebar extends BaseComponent {
240
232
return Boolean ( window . getComputedStyle ( this . _element , null ) . getPropertyValue ( '--cui-is-mobile' ) )
241
233
}
242
234
243
- _isIOS ( ) {
244
- const iOSDevices = [
245
- 'iPad Simulator' ,
246
- 'iPhone Simulator' ,
247
- 'iPod Simulator' ,
248
- 'iPad' ,
249
- 'iPhone' ,
250
- 'iPod'
251
- ]
252
-
253
- const platform = Boolean ( navigator . platform )
254
-
255
- if ( platform ) {
256
- while ( iOSDevices . length ) {
257
- if ( navigator . platform === iOSDevices . pop ( ) ) {
258
- return true
259
- }
260
- }
261
- }
262
-
263
- return false
264
- }
265
-
266
235
_isNarrow ( ) {
267
236
return this . _element . classList . contains ( CLASS_NAME_SIDEBAR_NARROW )
268
237
}
0 commit comments