Skip to content

Commit 1a4e40f

Browse files
author
Erwin Dondorp
committed
optimised toggleSelection, do final stuff only once
1 parent 203b062 commit 1a4e40f

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

saltgui/static/scripts/panels/Panel.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@ export class Panel {
204204

205205
toggleSelection () {
206206
let selectMinions = Utils.getStorageItem("session", "select_minions", ",");
207+
207208
for (const tr of this.table.tBodies[0].children) {
208209
const td = tr.children[0];
209210
if (td.innerText === Character.BALLOT_BOX_UNCHECKED) {
@@ -212,12 +213,12 @@ export class Panel {
212213
} else {
213214
td.innerText = Character.BALLOT_BOX_UNCHECKED;
214215
selectMinions = selectMinions.replace("," + tr.dataset.minionId + ",", ",");
215-
selectMinions = selectMinions.replace("," + tr.dataset.minionId + ",", ",");
216216
}
217-
Utils.setStorageItem("session", "select_minions", selectMinions);
218-
219-
this.updateFooter();
220217
}
218+
219+
Utils.setStorageItem("session", "select_minions", selectMinions);
220+
221+
this.updateFooter();
221222
}
222223

223224
addTable (pColumnNames, pFieldList = null) {

0 commit comments

Comments
 (0)