diff options
Diffstat (limited to 'ext/js/pages/action-popup-main.js')
| -rw-r--r-- | ext/js/pages/action-popup-main.js | 11 | 
1 files changed, 8 insertions, 3 deletions
| diff --git a/ext/js/pages/action-popup-main.js b/ext/js/pages/action-popup-main.js index 94b9b356..f8dd865f 100644 --- a/ext/js/pages/action-popup-main.js +++ b/ext/js/pages/action-popup-main.js @@ -17,6 +17,7 @@   */  import {PermissionsUtil} from '../data/permissions-util.js'; +import {querySelectorNotNull} from '../dom/query-selector.js';  import {HotkeyHelpController} from '../input/hotkey-help-controller.js';  import {yomitan} from '../yomitan.js'; @@ -57,7 +58,9 @@ export class DisplayController {              this._setupOptions(primaryProfile);          } -        /** @type {HTMLElement} */ (document.querySelector('.action-select-profile')).hidden = (profiles.length <= 1); +        /** @type {HTMLElement} */ +        const profileSelect = querySelectorNotNull(document, '.action-select-profile'); +        profileSelect.hidden = (profiles.length <= 1);          this._updateProfileSelect(profiles, profileCurrent); @@ -207,8 +210,10 @@ export class DisplayController {       * @param {number} profileCurrent       */      _updateProfileSelect(profiles, profileCurrent) { -        const select = /** @type {HTMLSelectElement} */ (document.querySelector('#profile-select')); -        const optionGroup = /** @type {HTMLElement} */ (document.querySelector('#profile-select-option-group')); +        /** @type {HTMLSelectElement} */ +        const select = querySelectorNotNull(document, '#profile-select'); +        /** @type {HTMLElement} */ +        const optionGroup = querySelectorNotNull(document, '#profile-select-option-group');          const fragment = document.createDocumentFragment();          for (let i = 0, ii = profiles.length; i < ii; ++i) {              const {name} = profiles[i]; |