aboutsummaryrefslogtreecommitdiff
path: root/src/content
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2017-08-22 21:55:16 +0900
committerShin'ya Ueoka <ueokande@i-beam.org>2017-08-22 21:55:16 +0900
commitdcebe336281d068649927a8bb8d3c0403807ef01 (patch)
treef2e933c927baf64cc393ea1a83ed57cc1fcc9bb2 /src/content
parent685164629da8a28fae19128a198ba6b9a57e55f9 (diff)
add scroll to hint position
Diffstat (limited to 'src/content')
-rw-r--r--src/content/hint.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/content/hint.js b/src/content/hint.js
index f59899d..fabf725 100644
--- a/src/content/hint.js
+++ b/src/content/hint.js
@@ -10,12 +10,14 @@ export default class Hint {
let doc = target.ownerDocument
let { top, left } = target.getBoundingClientRect();
+ let scrollX = window.scrollX;
+ let scrollY = window.scrollY;
this.element = doc.createElement('span');
this.element.className = 'vimvixen-hint';
this.element.textContent = tag;
- this.element.style.top = top + 'px';
- this.element.style.left = left + 'px';
+ this.element.style.left = left + scrollX + 'px';
+ this.element.style.top = top + scrollY + 'px';
this.show();
doc.body.append(this.element);