@pageboard/html 0.13.5 → 0.13.6

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pageboard/html",
3
- "version": "0.13.5",
3
+ "version": "0.13.6",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "repository": {
package/ui/image.js CHANGED
@@ -162,7 +162,7 @@ const HTMLElementImageConstructor = Superclass => class extends Superclass {
162
162
  const curSrc = loc.toString();
163
163
  if (curSrc != this.currentSrc) {
164
164
  this.classList.add('loading');
165
- this.#defer?.resolve();
165
+ this.#defer?.reject();
166
166
  this.#defer = new Deferred();
167
167
  img.setAttribute('src', curSrc);
168
168
  return this.#defer;
@@ -174,7 +174,7 @@ const HTMLElementImageConstructor = Superclass => class extends Superclass {
174
174
  this.fix(this.image);
175
175
  }
176
176
  captureError() {
177
- this.#defer.resolve();
177
+ this.#defer.reject();
178
178
  this.classList.remove('loading');
179
179
  this.classList.add('error');
180
180
  this.placeholder(true);
@@ -213,6 +213,13 @@ class HTMLElementInlineImage extends HTMLElementImageConstructor(Page.create(HTM
213
213
  if (!cur && this.image.src?.startsWith('data:')) return this.src;
214
214
  else return cur;
215
215
  }
216
+
217
+ captureLoad() {
218
+ super.captureLoad();
219
+ }
220
+ captureError() {
221
+ super.captureError();
222
+ }
216
223
  }
217
224
 
218
225
  Page.define('element-image', HTMLElementImage);
package/ui/layout.js CHANGED
@@ -56,11 +56,11 @@ class HTMLElementLayout extends Page.create(HTMLDivElement) {
56
56
  } catch(e) {
57
57
  // pass
58
58
  }
59
- this.#defer?.resolve();
59
+ this.#defer?.reject();
60
60
  this.#defer = new Deferred();
61
61
  const img = new Image();
62
62
  img.addEventListener('load', this.#defer.resolve);
63
- img.addEventListener('error', this.#defer.resolve);
63
+ img.addEventListener('error', this.#defer.reject);
64
64
  img.src = curSrc;
65
65
  this.style.backgroundImage = `url("${curSrc}")`;
66
66
  return this.#defer;