aboutsummaryrefslogtreecommitdiff
path: root/ext/fg
diff options
context:
space:
mode:
authorAlex Yatskov <alex@foosoft.net>2016-04-24 11:26:42 -0700
committerAlex Yatskov <alex@foosoft.net>2016-04-24 11:26:42 -0700
commit7f661fdd813ff1b792758f3e9450e99eae5b3827 (patch)
tree0cce85c42774ad7f3c90449dcdc39b0ba18f950d /ext/fg
parent709094455e77d8ceba199316631381fcad47ef5d (diff)
Cleanup
Diffstat (limited to 'ext/fg')
-rw-r--r--ext/fg/css/popup.css1
-rw-r--r--ext/fg/js/client.js8
2 files changed, 6 insertions, 3 deletions
diff --git a/ext/fg/css/popup.css b/ext/fg/css/popup.css
index b10c06f2..893f4e4a 100644
--- a/ext/fg/css/popup.css
+++ b/ext/fg/css/popup.css
@@ -23,6 +23,7 @@ body {
font-size: 14px;
line-height: 1.42857143;
overflow-y: auto;
+ padding: 5px;
}
.term {
diff --git a/ext/fg/js/client.js b/ext/fg/js/client.js
index a7c11e92..bc389818 100644
--- a/ext/fg/js/client.js
+++ b/ext/fg/js/client.js
@@ -22,6 +22,8 @@ class Client {
this.popup = new Popup();
this.lastMousePos = null;
this.lastRange = null;
+ this.activateKey = 16;
+ this.activateBtn = 2;
this.enabled = false;
this.options = {};
@@ -40,21 +42,21 @@ class Client {
}
onKeyDown(e) {
- if (this.enabled && this.lastMousePos !== null && (e.keyCode === 16 || e.charCode === 16)) {
+ if (this.enabled && this.lastMousePos !== null && (e.keyCode === this.activateKey || e.charCode === this.activateKey)) {
this.searchAt(this.lastMousePos);
}
}
onMouseMove(e) {
this.lastMousePos = {x: e.clientX, y: e.clientY};
- if (this.enabled && (e.shiftKey || e.which === 2)) {
+ if (this.enabled && (e.shiftKey || e.which === this.activateBtn)) {
this.searchAt(this.lastMousePos);
}
}
onMouseDown(e) {
this.lastMousePos = {x: e.clientX, y: e.clientY};
- if (this.enabled && (e.shiftKey || e.which === 2)) {
+ if (this.enabled && (e.shiftKey || e.which === this.activateBtn)) {
this.searchAt(this.lastMousePos);
} else {
this.hidePopup();