Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions src/fsm-sticky-header.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -23,7 +23,7 @@

var unbindScrollBodyWatcher = scope.$watch('scrollBody', function(newValue, oldValue) {
content = $(scope.scrollBody);
init();
$timeout( init, 500);
unbindScrollBodyWatcher();
});

Expand Down Expand Up @@ -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();
};
Expand Down Expand Up @@ -398,7 +404,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);
Expand Down