navigate history with wheel only over buttons
This commit is contained in:
parent
df06251cb0
commit
e99c8c40a1
@ -211,6 +211,11 @@ class Display {
|
|||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
}
|
}
|
||||||
} else if (e.shiftKey) {
|
} else if (e.shiftKey) {
|
||||||
|
this.onHistoryWheel(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onHistoryWheel(e) {
|
||||||
const delta = -e.deltaX || e.deltaY;
|
const delta = -e.deltaX || e.deltaY;
|
||||||
if (delta > 0) {
|
if (delta > 0) {
|
||||||
this.sourceTermView();
|
this.sourceTermView();
|
||||||
@ -220,7 +225,6 @@ class Display {
|
|||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
onRuntimeMessage({action, params}, sender, callback) {
|
onRuntimeMessage({action, params}, sender, callback) {
|
||||||
const handlers = Display.runtimeMessageHandlers;
|
const handlers = Display.runtimeMessageHandlers;
|
||||||
@ -301,6 +305,7 @@ class Display {
|
|||||||
this.addEventListeners('.kanji-link', 'click', this.onKanjiLookup.bind(this));
|
this.addEventListeners('.kanji-link', 'click', this.onKanjiLookup.bind(this));
|
||||||
this.addEventListeners('.source-term', 'click', this.onSourceTermView.bind(this));
|
this.addEventListeners('.source-term', 'click', this.onSourceTermView.bind(this));
|
||||||
this.addEventListeners('.next-term', 'click', this.onNextTermView.bind(this));
|
this.addEventListeners('.next-term', 'click', this.onNextTermView.bind(this));
|
||||||
|
this.addEventListeners('.term-navigation', 'wheel', this.onHistoryWheel.bind(this), {passive: false});
|
||||||
if (this.options.scanning.enablePopupSearch) {
|
if (this.options.scanning.enablePopupSearch) {
|
||||||
this.addEventListeners('.glossary-item', 'mouseup', this.onGlossaryMouseUp.bind(this));
|
this.addEventListeners('.glossary-item', 'mouseup', this.onGlossaryMouseUp.bind(this));
|
||||||
this.addEventListeners('.glossary-item', 'mousedown', this.onGlossaryMouseDown.bind(this));
|
this.addEventListeners('.glossary-item', 'mousedown', this.onGlossaryMouseDown.bind(this));
|
||||||
|
Loading…
Reference in New Issue
Block a user