Skip to content
This repository was archived by the owner on Nov 6, 2023. It is now read-only.

Commit 66c2e97

Browse files
Chan Chak Shingzoracon
authored andcommitted
Update chromium/pages/popup/ux.js, fix #17916 (#17917)
1 parent 211fffa commit 66c2e97

File tree

1 file changed

+5
-5
lines changed
  • chromium/pages/popup

1 file changed

+5
-5
lines changed

chromium/pages/popup/ux.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
function toggleRuleLine(event) {
1414
getTab(activeTab => {
1515
const set_ruleset = {
16-
active: event.target.parentNode.firstChild.checked,
17-
name: event.target.innerText,
16+
active: event.target.checked,
17+
name: event.target.parentNode.innerText,
1818
tab_id: activeTab.id,
1919
};
2020

@@ -111,6 +111,9 @@ function appendRulesToListDiv(rulesets, list_div, ruleType) {
111111
checkbox.checked = ruleset.active;
112112
text.innerText = ruleset.name;
113113

114+
// Add listener to capture the toggle event
115+
line.addEventListener("click", toggleRuleLine);
116+
114117
if (ruleset.note && ruleset.note.length) {
115118
line.title = ruleset.note;
116119

@@ -187,9 +190,6 @@ function listRules(activeTab) {
187190

188191
appendRulesToListDiv(stableRules, e("StableRules"), 'stable');
189192
appendRulesToListDiv(unstableRules, e("UnstableRules"), 'unstable');
190-
191-
// Add listener to capture the toggle event
192-
e("add-new-rule-button").addEventListener("click", toggleRuleLine);
193193
}
194194

195195
// Only show the "Add a rule" section if we're on an HTTPS page

0 commit comments

Comments
 (0)