aboutsummaryrefslogtreecommitdiff
path: root/ext/fg/js
diff options
context:
space:
mode:
authorAlex Yatskov <alex@foosoft.net>2017-03-25 15:59:33 -0700
committerAlex Yatskov <alex@foosoft.net>2017-03-25 15:59:33 -0700
commitb8d0788144974daab8d55c8de1af7515a291ba4f (patch)
tree32d778204049561b7f20c2e1a914ff6840340e86 /ext/fg/js
parent90eaae1725511bbc039f84f684b7b080e0fa2d44 (diff)
wip
Diffstat (limited to 'ext/fg/js')
-rw-r--r--ext/fg/js/display-frame.js4
-rw-r--r--ext/fg/js/driver.js18
2 files changed, 9 insertions, 13 deletions
diff --git a/ext/fg/js/display-frame.js b/ext/fg/js/display-frame.js
index 8f15b1bc..d930d325 100644
--- a/ext/fg/js/display-frame.js
+++ b/ext/fg/js/display-frame.js
@@ -47,6 +47,10 @@ window.displayFrame = new class extends Display {
}
}
+ clearSearch() {
+ window.parent.postMessage('popupClose', '*');
+ }
+
showOrphaned() {
$('#content').hide();
$('#orphan').show();
diff --git a/ext/fg/js/driver.js b/ext/fg/js/driver.js
index 5e17537e..7a56dd9c 100644
--- a/ext/fg/js/driver.js
+++ b/ext/fg/js/driver.js
@@ -46,14 +46,14 @@ window.driver = new class {
}
popupTimerClear() {
- if (this.popupTimer !== null) {
+ if (this.popupTimer) {
window.clearTimeout(this.popupTimer);
this.popupTimer = null;
}
}
onMouseOver(e) {
- if (e.target === this.popup.container && this.popuptimer !== null) {
+ if (e.target === this.popup.container && this.popupTimer) {
this.popupTimerClear();
}
}
@@ -106,14 +106,6 @@ window.driver = new class {
const handlers = {
popupClose: () => {
this.searchClear();
- },
-
- scanLeft: () => {
-
- },
-
- scanRight: () => {
-
}
};
@@ -147,11 +139,11 @@ window.driver = new class {
}
const textSource = docRangeFromPoint(point, this.options.scanning.imposter);
- if (textSource === null || !textSource.containsPoint(point)) {
+ if (!textSource || !textSource.containsPoint(point)) {
return;
}
- if (this.lastTextSource !== null && this.lastTextSource.equals(textSource)) {
+ if (this.lastTextSource && this.lastTextSource.equals(textSource)) {
return;
}
@@ -225,7 +217,7 @@ window.driver = new class {
docImposterDestroy();
this.popup.hide();
- if (this.options.scanning.selectText && this.lastTextSource !== null) {
+ if (this.options.scanning.selectText && this.lastTextSource) {
this.lastTextSource.deselect();
}