Commit f16d2f4 1 parent bea1e77 commit f16d2f4 Copy full SHA for f16d2f4
File tree 5 files changed +10
-11
lines changed
5 files changed +10
-11
lines changed Original file line number Diff line number Diff line change @@ -223,9 +223,8 @@ class Magellan extends Plugin {
223
223
window . location . hash . replace ( hash , '' ) ;
224
224
}
225
225
226
- $ ( window )
227
- . off ( 'hashchange' , this . _deepLinkScroll )
228
- . off ( this . onLoadListener ) ;
226
+ $ ( window ) . off ( 'hashchange' , this . _deepLinkScroll )
227
+ if ( this . onLoadListener ) $ ( window ) . off ( this . onLoadListener ) ;
229
228
}
230
229
}
231
230
Original file line number Diff line number Diff line change @@ -447,7 +447,7 @@ class OffCanvas extends Plugin {
447
447
this . close ( ) ;
448
448
this . $element . off ( '.zf.trigger .zf.offcanvas' ) ;
449
449
this . $overlay . off ( '.zf.offcanvas' ) ;
450
- $ ( window ) . off ( this . onLoadListener ) ;
450
+ if ( this . onLoadListener ) $ ( window ) . off ( this . onLoadListener ) ;
451
451
}
452
452
}
453
453
Original file line number Diff line number Diff line change @@ -502,9 +502,8 @@ class Reveal extends Plugin {
502
502
}
503
503
this . $element . hide ( ) . off ( ) ;
504
504
this . $anchor . off ( '.zf' ) ;
505
- $ ( window )
506
- . off ( `.zf.reveal:${ this . id } ` )
507
- . off ( this . onLoadListener ) ;
505
+ $ ( window ) . off ( `.zf.reveal:${ this . id } ` )
506
+ if ( this . onLoadListener ) $ ( window ) . off ( this . onLoadListener ) ;
508
507
509
508
if ( $ ( '.reveal:visible' ) . length === 0 ) {
510
509
this . _removeGlobalClasses ( ) ; // also remove .is-reveal-open from the html element when there is no opened reveal
Original file line number Diff line number Diff line change @@ -403,9 +403,8 @@ class Sticky extends Plugin {
403
403
if ( this . $anchor && this . $anchor . length ) {
404
404
this . $anchor . off ( 'change.zf.sticky' ) ;
405
405
}
406
- $ ( window )
407
- . off ( this . scrollListener )
408
- . off ( this . onLoadListener ) ;
406
+ if ( this . scrollListener ) $ ( window ) . off ( this . scrollListener )
407
+ if ( this . onLoadListener ) $ ( window ) . off ( this . onLoadListener )
409
408
410
409
if ( this . wasWrapped ) {
411
410
this . $element . unwrap ( ) ;
Original file line number Diff line number Diff line change @@ -394,7 +394,9 @@ class Tabs extends Plugin {
394
394
$ ( window ) . off ( 'hashchange' , this . _checkDeepLink ) ;
395
395
}
396
396
397
- $ ( window ) . off ( this . onLoadListener ) ;
397
+ if ( this . onLoadListener ) {
398
+ $ ( window ) . off ( this . onLoadListener ) ;
399
+ }
398
400
}
399
401
}
400
402
You can’t perform that action at this time.
0 commit comments