From b61fef3205dfefe5a4832841dbeb625a968603fe Mon Sep 17 00:00:00 2001 From: jlukic Date: Mon, 13 Jul 2015 18:09:46 -0400 Subject: [PATCH] #2605 last scroll value should only be saved if element scroll position changes --- src/definitions/modules/sticky.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/definitions/modules/sticky.js b/src/definitions/modules/sticky.js index 55fc76c98..446fa94ad 100644 --- a/src/definitions/modules/sticky.js +++ b/src/definitions/modules/sticky.js @@ -475,6 +475,8 @@ $.fn.sticky = function(parameters) { // scroll element if larger than screen else if(doesntFit) { module.set.scroll(elementScroll); + module.save.lastScroll(scroll.top); + module.save.elementScroll(elementScroll); } } @@ -494,6 +496,8 @@ $.fn.sticky = function(parameters) { // scroll element if larger than screen else if(doesntFit) { module.set.scroll(elementScroll); + module.save.lastScroll(scroll.top); + module.save.elementScroll(elementScroll); } } @@ -513,10 +517,6 @@ $.fn.sticky = function(parameters) { } } } - - // save current scroll for next run - module.save.lastScroll(scroll.top); - module.save.elementScroll(elementScroll); }, bindTop: function() {