cotomy 0.4.3 → 0.4.4
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/README.md +2 -2
- package/dist/browser/cotomy.js +1 -1
- package/dist/browser/cotomy.js.map +1 -1
- package/dist/browser/cotomy.min.js +1 -1
- package/dist/browser/cotomy.min.js.map +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/view.js +1 -1
- package/dist/esm/view.js.map +1 -1
- package/dist/types/view.d.ts +2 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -57,10 +57,10 @@ The View layer provides thin wrappers around DOM elements and window events.
|
|
|
57
57
|
- `is(selector: string): boolean` — Parent-aware matching helper
|
|
58
58
|
- `empty: boolean` — True for tags that cannot have children or have no content
|
|
59
59
|
- Attributes, classes, styles
|
|
60
|
-
- `attribute(name)` / `attribute(name, value | null): this`
|
|
60
|
+
- `attribute(name)` / `attribute(name, value | null | undefined): this` — `null`/`undefined` removes the attribute
|
|
61
61
|
- `hasAttribute(name): boolean`
|
|
62
62
|
- `addClass(name): this` / `removeClass(name): this` / `toggleClass(name, force?): this` / `hasClass(name): boolean`
|
|
63
|
-
- `style(name)` / `style(name, value | null): this`
|
|
63
|
+
- `style(name)` / `style(name, value | null | undefined): this` — `null`/`undefined` removes the style
|
|
64
64
|
- Content & value
|
|
65
65
|
- `text: string` (get/set)
|
|
66
66
|
- `html: string` (get/set)
|
package/dist/browser/cotomy.js
CHANGED
|
@@ -1492,7 +1492,7 @@ class CotomyElement {
|
|
|
1492
1492
|
if (arguments.length === 1) {
|
|
1493
1493
|
return this.element.hasAttribute(name) ? this.element.getAttribute(name) : undefined;
|
|
1494
1494
|
}
|
|
1495
|
-
else if (value
|
|
1495
|
+
else if (value == null) {
|
|
1496
1496
|
this.element.removeAttribute(name);
|
|
1497
1497
|
return this;
|
|
1498
1498
|
}
|