@pageboard/html 0.11.28 → 0.11.29
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/package.json +1 -1
- package/ui/image.js +4 -7
package/package.json
CHANGED
package/ui/image.js
CHANGED
|
@@ -95,8 +95,8 @@ class HTMLElementImage extends VirtualHTMLElement {
|
|
|
95
95
|
if (this.currentSrc != this.options.src) {
|
|
96
96
|
this.classList.remove('error');
|
|
97
97
|
}
|
|
98
|
-
this.dataset.width = this.constructor.defaultWidth;
|
|
99
|
-
this.dataset.height = this.constructor.defaultHeight;
|
|
98
|
+
this.dataset.width = this.constructor.defaultWidth || "";
|
|
99
|
+
this.dataset.height = this.constructor.defaultHeight || "";
|
|
100
100
|
if (this.options.src) {
|
|
101
101
|
const loc = Page.parse(this.options.src);
|
|
102
102
|
const meta = state.scope.$hrefs?.[loc.pathname];
|
|
@@ -106,8 +106,8 @@ class HTMLElementImage extends VirtualHTMLElement {
|
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
108
|
const { w, h } = this.dimensions;
|
|
109
|
-
this.image.width = w || this.dataset.width;
|
|
110
|
-
this.image.height = h || this.dataset.height;
|
|
109
|
+
if (w) this.image.width = w || this.dataset.width;
|
|
110
|
+
if (h) this.image.height = h || this.dataset.height;
|
|
111
111
|
if (!this.currentSrc) {
|
|
112
112
|
this.placeholder();
|
|
113
113
|
}
|
|
@@ -196,9 +196,6 @@ class HTMLElementInlineImage extends HTMLImageElement {
|
|
|
196
196
|
dataCrop: null
|
|
197
197
|
};
|
|
198
198
|
|
|
199
|
-
static defaultWidth = 40;
|
|
200
|
-
static defaultHeight = 30;
|
|
201
|
-
|
|
202
199
|
get image() {
|
|
203
200
|
return this;
|
|
204
201
|
}
|