@daz4126/helium 0.6.0 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/helium.js +6 -4
- package/package.json +1 -1
package/helium.js
CHANGED
|
@@ -3,6 +3,10 @@ export default function helium(data = {}) {
|
|
|
3
3
|
document.querySelector("[\\@helium]") ||
|
|
4
4
|
document.querySelector("[data-helium]") ||
|
|
5
5
|
document.body;
|
|
6
|
+
if (Object.keys(data).length > 0)
|
|
7
|
+
document
|
|
8
|
+
.querySelectorAll("[data-helium-processed]")
|
|
9
|
+
.forEach((el) => el.removeAttribute("data-helium-processed"));
|
|
6
10
|
const [bindings, refs] = [new Map(), new Map()];
|
|
7
11
|
const $ = (selector) => document.querySelector(selector);
|
|
8
12
|
const html = (string) => {
|
|
@@ -104,12 +108,10 @@ export default function helium(data = {}) {
|
|
|
104
108
|
element.nodeType === 1 &&
|
|
105
109
|
element.hasAttribute &&
|
|
106
110
|
element.hasAttribute("data-helium-processed")
|
|
107
|
-
)
|
|
111
|
+
)
|
|
108
112
|
return newlyAddedBindings;
|
|
109
|
-
|
|
110
|
-
if (element.nodeType === 1 && element.setAttribute) {
|
|
113
|
+
if (element.nodeType === 1 && element.setAttribute)
|
|
111
114
|
element.setAttribute("data-helium-processed", "");
|
|
112
|
-
}
|
|
113
115
|
|
|
114
116
|
const heliumElements = [
|
|
115
117
|
element,
|