diff options
Diffstat (limited to 'static/js/timeago.ts')
-rw-r--r-- | static/js/timeago.ts | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/static/js/timeago.ts b/static/js/timeago.ts index f794c4a..10206e3 100644 --- a/static/js/timeago.ts +++ b/static/js/timeago.ts @@ -10,9 +10,10 @@ function viewport(element, options = { offset: 100 }) { const view = element.getBoundingClientRect(); - return view.top >= -options.offset && view.left >= -options.offset && - view.bottom <= (window.innerHeight || self.documentElement.clientHeight) + options.offset && - view.right <= (window.innerWidth || self.documentElement.clientWidth) + options.offset; + return view.top >= -options.offset + && view.left >= -options.offset + && view.bottom <= (self.innerHeight || document.documentElement.clientHeight) + options.offset + && view.right <= (self.innerWidth || document.documentElement.clientWidth) + options.offset; } const date = function (update) { |