Cleanup, reset scroll position on definition lookup (#20)

This commit is contained in:
Alex Yatskov 2016-10-17 09:14:49 -07:00
parent aa1a2b0176
commit f22fcb0a5d
2 changed files with 6 additions and 2 deletions

View File

@ -100,9 +100,11 @@ class Driver {
} }
onMouseDown(e) { onMouseDown(e) {
this.lastMousePos = {x: e.clientX, y: e.clientY};
this.popupTimerClear();
if (this.popup.visible()) { if (this.popup.visible()) {
const selection = window.getSelection(); this.hidePopup();
selection.removeAllRanges();
} }
} }

View File

@ -66,6 +66,8 @@ class Popup {
return; return;
} }
this.container.contentWindow.scrollTo(0, 0);
const doc = this.container.contentDocument; const doc = this.container.contentDocument;
doc.open(); doc.open();
doc.write(content); doc.write(content);