summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorAlex Yatskov <alex@foosoft.net>2017-03-25 16:45:43 -0700
committerAlex Yatskov <alex@foosoft.net>2017-03-25 16:45:43 -0700
commit218db0771fae0754a50cadc1891a042112b58699 (patch)
tree00d1af89da017416a13e2a69ca97f678ef93d446 /ext
parentbc2bf51a072af45ddc61a7f6b1c5cc3b94f8ad3e (diff)
cleanup, firefox scrolling
Diffstat (limited to 'ext')
-rw-r--r--ext/bg/js/yomichan.js14
-rw-r--r--ext/fg/js/display-frame.js8
-rw-r--r--ext/fg/js/driver.js4
-rw-r--r--ext/mixed/js/display.js6
4 files changed, 16 insertions, 16 deletions
diff --git a/ext/bg/js/yomichan.js b/ext/bg/js/yomichan.js
index 1a34aba4..39105c54 100644
--- a/ext/bg/js/yomichan.js
+++ b/ext/bg/js/yomichan.js
@@ -192,32 +192,32 @@ window.yomichan = new class {
onMessage(request, sender, callback) {
const handlers = new class {
- api_optionsGet({callback}) {
+ optionsGet({callback}) {
promiseCallback(optionsLoad(), callback);
}
- api_kanjiFind({text, callback}) {
+ kanjiFind({text, callback}) {
promiseCallback(this.kanjiFind(text), callback);
}
- api_termsFind({text, callback}) {
+ termsFind({text, callback}) {
promiseCallback(this.termsFind(text), callback);
}
- api_templateRender({template, data, callback}) {
+ templateRender({template, data, callback}) {
promiseCallback(this.templateRender(template, data), callback);
}
- api_definitionAdd({definition, mode, callback}) {
+ definitionAdd({definition, mode, callback}) {
promiseCallback(this.definitionAdd(definition, mode), callback);
}
- api_definitionsAddable({definitions, modes, callback}) {
+ definitionsAddable({definitions, modes, callback}) {
promiseCallback(this.definitionsAddable(definitions, modes), callback);
}
};
- const {action, params} = request, method = handlers[`api_${action}`];
+ const {action, params} = request, method = handlers[action];
if (typeof(method) === 'function') {
params.callback = callback;
method.call(this, params);
diff --git a/ext/fg/js/display-frame.js b/ext/fg/js/display-frame.js
index d930d325..41c2fb53 100644
--- a/ext/fg/js/display-frame.js
+++ b/ext/fg/js/display-frame.js
@@ -58,20 +58,20 @@ window.displayFrame = new class extends Display {
onMessage(e) {
const handlers = new class {
- api_showTermDefs({definitions, options, context}) {
+ showTermDefs({definitions, options, context}) {
this.showTermDefs(definitions, options, context);
}
- api_showKanjiDefs({definitions, options, context}) {
+ showKanjiDefs({definitions, options, context}) {
this.showKanjiDefs(definitions, options, context);
}
- api_showOrphaned() {
+ showOrphaned() {
this.showOrphaned();
}
};
- const {action, params} = e.originalEvent.data, method = handlers[`api_${action}`];
+ const {action, params} = e.originalEvent.data, method = handlers[action];
if (typeof(method) === 'function') {
method.call(this, params);
}
diff --git a/ext/fg/js/driver.js b/ext/fg/js/driver.js
index 7a56dd9c..036dc2d8 100644
--- a/ext/fg/js/driver.js
+++ b/ext/fg/js/driver.js
@@ -117,7 +117,7 @@ window.driver = new class {
onBgMessage({action, params}, sender, callback) {
const handlers = new class {
- api_optionsSet(options) {
+ optionsSet(options) {
this.options = options;
if (!this.options.enable) {
this.searchClear();
@@ -125,7 +125,7 @@ window.driver = new class {
}
};
- const method = handlers[`api_${action}`];
+ const method = handlers[action];
if (typeof(method) === 'function') {
method.call(this, params);
}
diff --git a/ext/mixed/js/display.js b/ext/mixed/js/display.js
index 140185cc..50940e58 100644
--- a/ext/mixed/js/display.js
+++ b/ext/mixed/js/display.js
@@ -149,14 +149,14 @@ class Display {
$('.current').hide().eq(index).show();
- const body = $('body').stop();
+ const container = $('html,body').stop();
const entry = $('.entry').eq(index);
const target = index === 0 ? 0 : entry.offset().top;
if (smooth) {
- body.animate({scrollTop: target}, 200);
+ container.animate({scrollTop: target}, 200);
} else {
- body.scrollTop(target);
+ container.scrollTop(target);
}
this.index = index;