We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents e89be49 + 7c44dad commit 3f7c5a9Copy full SHA for 3f7c5a9
1 file changed
widget/directives.js
@@ -61,10 +61,13 @@
61
return {
62
restrict: 'A',
63
link: function (scope, element, attrs) {
64
- var raw = element[0];
+ let raw = element[0], timeOut = null, timer = 300;
65
element.on('scroll', function () {
66
- if (raw.scrollTop + raw.offsetHeight == raw.scrollHeight) { //at the bottom
67
- scope.$apply(attrs.scrolly);
+ if (raw.scrollTop + raw.offsetHeight >= (raw.scrollHeight*0.60)) { //at the bottom
+ clearTimeout(timeOut);
68
+ timeOut = setTimeout(()=>{
69
+ scope.$apply(attrs.scrolly);
70
+ }, timer)
71
}
72
})
73
0 commit comments