]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
updates sticky.destroy method to remove scroll event listener from window. was not...
authorChris Oyler <chris@zurb.com>
Thu, 17 Dec 2015 21:42:12 +0000 (13:42 -0800)
committerChris Oyler <chris@zurb.com>
Thu, 17 Dec 2015 21:42:12 +0000 (13:42 -0800)
js/foundation.sticky.js

index cf17b611b28ff3d58456029a49d3d16145c07cc4..b51a6ca397fec232ce8b96bb56c2d420360e0131 100644 (file)
   Sticky.prototype._events = function(id){
     // console.log('called');
     var _this = this,
-        scrollListener = 'scroll.zf.' + id;
+        scrollListener = this.scrollListener = 'scroll.zf.' + id;
     if(this.isOn){ return; }
     if(this.canStick){
       this.isOn = true;
                  .off('resizeme.zf.trigger');
 
     this.$anchor.off('change.zf.sticky');
-    $(window).off('scroll.zf.sticky');
+    $(window).off(this.scrollListener);
 
     if(this.wasWrapped){
       this.$element.unwrap();