]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
[Bugfix] Sticky : Fixes #8393. anchor object undefined when destroying element with... 8719/head
authorg.chanaud <g.chanaud@regence-production.ch>
Sun, 1 May 2016 11:04:34 +0000 (13:04 +0200)
committerg.chanaud <g.chanaud@regence-production.ch>
Sun, 1 May 2016 11:04:34 +0000 (13:04 +0200)
js/foundation.sticky.js

index cfe356ffc219b722731831a803fe0d95f68701f9..3836056ee1b45006ec45a90b1d0123a9fcd4396c 100644 (file)
@@ -355,8 +355,9 @@ class Sticky {
                    'max-width': ''
                  })
                  .off('resizeme.zf.trigger');
-
-    this.$anchor.off('change.zf.sticky');
+    if (this.$anchor && this.$anchor.length) {
+      this.$anchor.off('change.zf.sticky');
+    }
     $(window).off(this.scrollListener);
 
     if (this.wasWrapped) {