summaryrefslogtreecommitdiff
path: root/ext/bg/js/settings/anki-templates-controller.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2021-01-19 20:52:57 -0500
committerGitHub <noreply@github.com>2021-01-19 20:52:57 -0500
commitccf28ed055f08d38d28b19025d10cb4e7424464b (patch)
tree32c40a92149415c54ffd51b7868ae24d468cbaaa /ext/bg/js/settings/anki-templates-controller.js
parent3c51bf2a0be7c35f86d2da8c381453b95e6414bf (diff)
Menu refactor (#1277)
* Rename menuOpened event to menuOpen * Rename menuClosed event to menuClose * Rename close event * Assign _isClosed * Reuse event detail * Expose PopupMenu.openMenus * Rename and expose properties * Add cancelable argument to close * Update menuOpen detail * Update menuClose detail
Diffstat (limited to 'ext/bg/js/settings/anki-templates-controller.js')
-rw-r--r--ext/bg/js/settings/anki-templates-controller.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/bg/js/settings/anki-templates-controller.js b/ext/bg/js/settings/anki-templates-controller.js
index 6bd1bad7..125d8e16 100644
--- a/ext/bg/js/settings/anki-templates-controller.js
+++ b/ext/bg/js/settings/anki-templates-controller.js
@@ -69,7 +69,7 @@ class AnkiTemplatesController {
resetButton.addEventListener('click', this._onReset.bind(this), false);
resetConfirmButton.addEventListener('click', this._onResetConfirm.bind(this), false);
if (menuButton !== null) {
- menuButton.addEventListener('menuClosed', this._onFieldMenuClosed.bind(this), false);
+ menuButton.addEventListener('menuClose', this._onFieldMenuClose.bind(this), false);
}
this._settingsController.on('optionsChanged', this._onOptionsChanged.bind(this));
@@ -138,10 +138,10 @@ class AnkiTemplatesController {
this._validate(infoNode, field, 'term-kanji', true, false);
}
- _onFieldMenuClosed({currentTarget: node, detail: {action, item}}) {
+ _onFieldMenuClose({currentTarget: button, detail: {action, item}}) {
switch (action) {
case 'setFieldMarker':
- this._setFieldMarker(node, item.dataset.marker);
+ this._setFieldMarker(button, item.dataset.marker);
break;
}
}