summaryrefslogtreecommitdiff
path: root/ext/fg/js/popup.js
diff options
context:
space:
mode:
authorAlex Yatskov <FooSoft@users.noreply.github.com>2019-03-07 11:31:06 -0800
committerGitHub <noreply@github.com>2019-03-07 11:31:06 -0800
commitc7f8d0874a758924802179a44757153bbf18bf7f (patch)
tree3191c8015cc23667c4089cd551ec521183b61ac8 /ext/fg/js/popup.js
parent27fb9643e471dbd1c0e6a19023a449bf7688bd71 (diff)
parent0b8ae6c53a4b5b358a0af0617ccada019630d683 (diff)
Merge pull request #157 from toasted-nutbread/touch-input
Add support for touch input
Diffstat (limited to 'ext/fg/js/popup.js')
-rw-r--r--ext/fg/js/popup.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/ext/fg/js/popup.js b/ext/fg/js/popup.js
index a17b184a..14276efe 100644
--- a/ext/fg/js/popup.js
+++ b/ext/fg/js/popup.js
@@ -62,6 +62,7 @@ class Popup {
}
}
+ let above = false;
let y = 0;
let height = Math.max(containerHeight, options.general.popupHeight);
const yBelow = elementRect.bottom + options.general.popupOffset;
@@ -75,11 +76,14 @@ class Popup {
} else {
height = Math.max(height - overflowAbove, 0);
y = Math.max(yAbove - height, 0);
+ above = true;
}
} else {
y = yBelow;
}
+ this.container.classList.toggle('yomichan-float-full-width', options.general.popupDisplayMode === 'full-width');
+ this.container.classList.toggle('yomichan-float-above', above);
this.container.style.left = `${x}px`;
this.container.style.top = `${y}px`;
this.container.style.width = `${width}px`;