Skip to content

Commit 36daacb

Browse files
committed
Undo arg order change
1 parent 5cc2a6c commit 36daacb

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

include-fragment-element.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,17 @@ function fire(name, target) {
1010
}, 0)
1111
}
1212

13-
function handleData(data, target) {
13+
function handleData(el, data) {
1414
return data.then(
1515
function(html) {
16-
const parentNode = target.parentNode
16+
const parentNode = el.parentNode
1717
if (parentNode) {
18-
target.insertAdjacentHTML('afterend', html)
19-
parentNode.removeChild(target)
18+
el.insertAdjacentHTML('afterend', html)
19+
parentNode.removeChild(el)
2020
}
2121
},
2222
function() {
23-
target.classList.add('is-error')
23+
el.classList.add('is-error')
2424
}
2525
)
2626
}
@@ -84,15 +84,15 @@ export class IncludeFragmentElement extends HTMLElement {
8484

8585
// Source changed after attached so replace element.
8686
if (this._attached) {
87-
handleData(data, this)
87+
handleData(this, data)
8888
}
8989
}
9090
}
9191

9292
connectedCallback() {
9393
this._attached = true
9494
if (this.src) {
95-
handleData(this.getData(), this)
95+
handleData(this, this.getData())
9696
}
9797
}
9898

0 commit comments

Comments
 (0)