Skip to content

Commit 2f95379

Browse files
committed
maint(pat-stacks): Adapt code to Patternslib standards.
1 parent 8835ac6 commit 2f95379

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/pat/stacks/stacks.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ class Pattern extends BasePattern {
7272
if (base_url !== href_parts[0] || !href_parts[1]) {
7373
return;
7474
}
75-
if (!this.$el.has("#" + href_parts[1]).length) {
75+
if (!this.$el.has(`#${href_parts[1]}`).length) {
7676
return;
7777
}
7878
e.preventDefault();
@@ -89,20 +89,20 @@ class Pattern extends BasePattern {
8989
_updateAnchors(selected) {
9090
const $sheets = this.$el.find(this.options.selector);
9191
const base_url = this._base_URL();
92-
$sheets.each(function (idx, sheet) {
92+
for (const sheet of $sheets) {
9393
// This may appear odd, but: when querying a browser uses the
9494
// original href of an anchor as it appeared in the document
9595
// source, but when you access the href property you always get
9696
// the fully qualified version.
97-
var $anchors = $(
98-
'a[href="' + base_url + "#" + sheet.id + '"],a[href="#' + sheet.id + '"]'
97+
const $anchors = $(
98+
`a[href="${base_url}#${sheet.id}"], a[href="#${sheet.id}"]`
9999
);
100100
if (sheet.id === selected) {
101101
$anchors.addClass("current");
102102
} else {
103103
$anchors.removeClass("current");
104104
}
105-
});
105+
}
106106
}
107107

108108
_switch(sheet_id) {

0 commit comments

Comments
 (0)