From 4698d5ad556d29cec2ff3afbef040c7cd062e6f5 Mon Sep 17 00:00:00 2001 From: chaaben Date: Mon, 17 Apr 2017 18:54:31 +0100 Subject: [PATCH 1/2] fix problem $digest already in progress, when app integrated fsmStickyHeader bind scroll event --- src/fsm-sticky-header.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/fsm-sticky-header.js b/src/fsm-sticky-header.js index 4a61e29..5e96fe1 100644 --- a/src/fsm-sticky-header.js +++ b/src/fsm-sticky-header.js @@ -3,7 +3,7 @@ (function(angular){ var fsm = angular.module('fsm', []); - fsm.directive('fsmStickyHeader', [function(){ + fsm.directive('fsmStickyHeader', ['$timeout', function($timeout){ return { restrict: 'EA', replace: false, @@ -23,7 +23,7 @@ var unbindScrollBodyWatcher = scope.$watch('scrollBody', function(newValue, oldValue) { content = $(scope.scrollBody); - init(); + $timeout( init, 500); unbindScrollBodyWatcher(); }); @@ -398,7 +398,7 @@ var scrollPercent = (s / (d-c)); if (scrollPercent > 0.98) { - // We use scope.apply here to tell angular about these changes because + // We use scope.apply here to tell angular about these changes because // they happen outside of angularjs context... we're using jquery here // to figure out when we need to load another page of data. transcludedScope.$apply(nextPage); From 1c3228cdd99af8030d75f1862514e2c97301be5c Mon Sep 17 00:00:00 2001 From: chaaben Date: Tue, 2 May 2017 10:19:08 +0100 Subject: [PATCH 2/2] fix Fix problem header displayed in new position after delay --- src/fsm-sticky-header.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/fsm-sticky-header.js b/src/fsm-sticky-header.js index 5e96fe1..b5eb440 100644 --- a/src/fsm-sticky-header.js +++ b/src/fsm-sticky-header.js @@ -106,7 +106,13 @@ clonedHeader.css({ position: 'fixed', 'z-index': scope.fsmZIndex || 10000, - visibility: 'hidden' + visibility: 'hidden', + /* + Fix problem header displayed in new position after delay + when scrolling. + https://stanko.github.io/ios-safari-scoll-position-fixed/ + */ + transform: 'translate3d(0,0,0)' }); calculateSize(); };