aboutsummaryrefslogtreecommitdiff
path: root/static/js/timeago.ts
diff options
context:
space:
mode:
authortdro <tdro@noreply.example.com>2023-11-22 15:06:15 -0500
committertdro <tdro@noreply.example.com>2023-11-22 15:06:15 -0500
commit35f491efb88c9e35e87b719a9e8b1be90c3c5918 (patch)
tree434e039282d384bf308a9393f7bd1b2d6c38d268 /static/js/timeago.ts
parent9a38bf790011a771a753ef6e01bf7c2b5d5635c8 (diff)
downloadcanory-35f491efb88c9e35e87b719a9e8b1be90c3c5918.tar.gz
canory-35f491efb88c9e35e87b719a9e8b1be90c3c5918.tar.bz2
canory-35f491efb88c9e35e87b719a9e8b1be90c3c5918.zip
static/js: Ensure correct width and height references
Diffstat (limited to 'static/js/timeago.ts')
-rw-r--r--static/js/timeago.ts7
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) {