Skip to content

Commit 78ffe76

Browse files
Erwin Dondorperwindon
authored andcommitted
stop using replaceAll
1 parent 988c763 commit 78ffe76

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

saltgui/static/scripts/DropDown.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,9 @@ export class DropDownMenu {
114114

115115
static _sanitizeMenuItemTitle (pTitle) {
116116
return pTitle.
117-
replaceAll(" ", Character.NO_BREAK_SPACE).
118-
replaceAll("-", Character.NON_BREAKING_HYPHEN).
119-
replaceAll("...", Character.HORIZONTAL_ELLIPSIS);
117+
replace(/ /g, Character.NO_BREAK_SPACE).
118+
replace(/-/g, Character.NON_BREAKING_HYPHEN).
119+
replace(/[.][.][.]/g, Character.HORIZONTAL_ELLIPSIS);
120120
}
121121

122122
// Add a menu item at the end of this dropdown menu

saltgui/static/scripts/panels/Grains.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export class GrainsPanel extends Panel {
3434
// the div is not added to the DOM yet
3535
const tr = this.div.querySelector("#grains-table-thead-tr");
3636
for (const previewGrain of this.previewGrains) {
37-
const previewGrainTitle = previewGrain.replaceAll(/[=].*$/g, "");
37+
const previewGrainTitle = previewGrain.replace(/[=].*$/g, "");
3838
const th = Utils.createElem("th", "", previewGrainTitle);
3939
tr.appendChild(th);
4040
}
@@ -138,7 +138,7 @@ export class GrainsPanel extends Panel {
138138
for (const previewGrain of this.previewGrains) {
139139
const td = Utils.createTd();
140140
if (typeof pMinionData === "object") {
141-
const previewGrainValue = previewGrain.replaceAll(/^[^=]*=/g, "");
141+
const previewGrainValue = previewGrain.replace(/^[^=]*=/g, "");
142142
if (previewGrainValue.startsWith("$")) {
143143
// it is a json path
144144
const obj = jsonPath(pMinionData, previewGrainValue);

saltgui/static/scripts/panels/Panel.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -765,7 +765,7 @@ export class Panel {
765765
txt += ", press " + Character.buttonInText(Character.CH_PAUSE) + " to pause";
766766
}
767767

768-
txt = txt.replaceAll(/^, /g, "");
768+
txt = txt.replace(/^, /g, "");
769769

770770
this.setMsg(txt.length > 0 ? txt : "(???)");
771771
}

0 commit comments

Comments
 (0)