Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix add profile conditions #416

Merged
merged 3 commits into from
Dec 22, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix add profile conditions
Casheeew committed Dec 21, 2023
commit cf18a53f312defbc200bb5c0bb9fd607bdd6980c
8 changes: 4 additions & 4 deletions ext/js/pages/settings/profile-conditions-ui.js
Original file line number Diff line number Diff line change
@@ -459,7 +459,7 @@ class ProfileConditionGroupUI {
/** @type {HTMLElement} */
this._node = /** @type {HTMLElement} */ (this._parent.instantiateTemplate('profile-condition-group'));
/** @type {HTMLElement} */
this._conditionContainer = querySelectorNotNull(this._node, '.profile-condition-list');
this._conditionContainer = /** @type {HTMLElement} */ (this._node.querySelector('.profile-condition-list'));
/** @type {HTMLElement} */
this._addConditionButton = querySelectorNotNull(this._node, '.profile-condition-add-button');
/** @type {ProfileConditionUI[]} */
@@ -624,13 +624,13 @@ class ProfileConditionUI {
/** @type {HTMLSelectElement} */
this._operatorInput = querySelectorNotNull(this._node, '.profile-condition-operator');
/** @type {HTMLButtonElement} */
this._removeButton = querySelectorNotNull(this._node, '.profile-condition-remove');
this._removeButton = /** @type {HTMLButtonElement} */ (this._node.querySelector('.profile-condition-remove'));
/** @type {HTMLButtonElement} */
this._mouseButton = querySelectorNotNull(this._node, '.mouse-button');
/** @type {HTMLElement} */
this._mouseButtonContainer = querySelectorNotNull(this._node, '.mouse-button-container');
/** @type {HTMLButtonElement} */
this._menuButton = querySelectorNotNull(this._node, '.profile-condition-menu-button');
this._menuButton = /** @type {HTMLButtonElement} */ (this._node.querySelector('.profile-condition-menu-button'));
/** @type {HTMLElement} */
this._typeOptionContainer = querySelectorNotNull(this._typeInput, 'optgroup');
/** @type {HTMLElement} */
@@ -777,7 +777,7 @@ class ProfileConditionUI {
_onMenuOpen(e) {
const bodyNode = e.detail.menu.bodyNode;
/** @type {HTMLElement} */
const deleteGroup = querySelectorNotNull(bodyNode, '.popup-menu-item[data-menu-action="deleteGroup"]');
const deleteGroup = /** @type {HTMLElement} */ (bodyNode.querySelector('.popup-menu-item[data-menu-action="deleteGroup"]'));
if (deleteGroup !== null) {
deleteGroup.hidden = (this._parent.childCount <= 1);
}