From: g.chanaud Date: Sun, 1 May 2016 11:04:34 +0000 (+0200) Subject: [Bugfix] Sticky : Fixes #8393. anchor object undefined when destroying element with... X-Git-Tag: v6.2.2-rc1~5^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F8719%2Fhead;p=thirdparty%2Ffoundation%2Ffoundation-sites.git [Bugfix] Sticky : Fixes #8393. anchor object undefined when destroying element with no anchors set --- diff --git a/js/foundation.sticky.js b/js/foundation.sticky.js index cfe356ffc..3836056ee 100644 --- a/js/foundation.sticky.js +++ b/js/foundation.sticky.js @@ -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) {