Attempt to sorta fix the scroll locker resetting

This commit is contained in:
benmcmahon100
2015-08-20 16:48:46 +01:00
parent 27cac3067a
commit d52a2d8da0
6 changed files with 24 additions and 3 deletions

View File

@@ -383,6 +383,21 @@ $(document).ready(function() {
lockTop();
});
}
var execInProgress = false;
document.getElementById('scroll-locker').addEventListener('previewUpdateSpy', function(e){
if (!execInProgress){
execInProgress = true;
setTimeout(function(){
if($($('.scroll-locker').children()[0]).height()-800 > e.detail){
$('.scroll-locker').scrollTop(e.detail);
}
else {
$('.scroll-locker').animate({"scrollTop":$($('.scroll-locker').children()[0]).height()}, 175);
}
execInProgress = false;
}, 750);
}
}, false);
}
});