summaryrefslogtreecommitdiff
path: root/ext/js/pages
diff options
context:
space:
mode:
Diffstat (limited to 'ext/js/pages')
-rw-r--r--ext/js/pages/settings/dictionary-controller.js14
1 files changed, 6 insertions, 8 deletions
diff --git a/ext/js/pages/settings/dictionary-controller.js b/ext/js/pages/settings/dictionary-controller.js
index f0450892..291604e4 100644
--- a/ext/js/pages/settings/dictionary-controller.js
+++ b/ext/js/pages/settings/dictionary-controller.js
@@ -46,6 +46,10 @@ class DictionaryEntry {
/** @type {HTMLInputElement} */
this._priorityInput = querySelectorNotNull(fragment, '.dictionary-priority');
/** @type {HTMLButtonElement} */
+ this._upButton = querySelectorNotNull(fragment, '#dictionary-move-up');
+ /** @type {HTMLButtonElement} */
+ this._downButton = querySelectorNotNull(fragment, '#dictionary-move-down');
+ /** @type {HTMLButtonElement} */
this._menuButton = querySelectorNotNull(fragment, '.dictionary-menu-button');
/** @type {HTMLButtonElement} */
this._outdatedButton = querySelectorNotNull(fragment, '.dictionary-outdated-button');
@@ -77,6 +81,8 @@ class DictionaryEntry {
this._eventListeners.addEventListener(this._enabledCheckbox, 'settingChanged', this._onEnabledChanged.bind(this), false);
this._eventListeners.addEventListener(this._menuButton, 'menuOpen', this._onMenuOpen.bind(this), false);
this._eventListeners.addEventListener(this._menuButton, 'menuClose', this._onMenuClose.bind(this), false);
+ this._eventListeners.addEventListener(this._upButton, 'click', (() => { this._move(-1); }).bind(this), false);
+ this._eventListeners.addEventListener(this._downButton, 'click', (() => { this._move(1); }).bind(this), false);
this._eventListeners.addEventListener(this._outdatedButton, 'click', this._onOutdatedButtonClick.bind(this), false);
this._eventListeners.addEventListener(this._integrityButton, 'click', this._onIntegrityButtonClick.bind(this), false);
}
@@ -115,8 +121,6 @@ class DictionaryEntry {
_onMenuOpen(e) {
const bodyNode = e.detail.menu.bodyNode;
const count = this._dictionaryController.dictionaryOptionCount;
- this._setMenuActionEnabled(bodyNode, 'moveUp', this._index > 0);
- this._setMenuActionEnabled(bodyNode, 'moveDown', this._index < count - 1);
this._setMenuActionEnabled(bodyNode, 'moveTo', count > 1);
}
@@ -131,12 +135,6 @@ class DictionaryEntry {
case 'showDetails':
this._showDetails();
break;
- case 'moveUp':
- this._move(-1);
- break;
- case 'moveDown':
- this._move(1);
- break;
case 'moveTo':
this._showMoveToModal();
break;