@rogieking/figui3 1.8.2 → 1.8.3
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/fig.js +12 -1
- package/package.json +1 -1
package/fig.js
CHANGED
|
@@ -2042,13 +2042,21 @@ class FigImage extends HTMLElement {
|
|
|
2042
2042
|
|
|
2043
2043
|
// Get blob from canvas
|
|
2044
2044
|
canvas.toBlob((blob) => {
|
|
2045
|
-
this.blob
|
|
2045
|
+
if (this.blob) {
|
|
2046
|
+
URL.revokeObjectURL(this.blob);
|
|
2047
|
+
}
|
|
2048
|
+
if (blob) {
|
|
2049
|
+
this.blob = URL.createObjectURL(blob);
|
|
2050
|
+
}
|
|
2046
2051
|
});
|
|
2047
2052
|
};
|
|
2048
2053
|
this.image.src = src;
|
|
2049
2054
|
});
|
|
2050
2055
|
}
|
|
2051
2056
|
async #handleFileInput(e) {
|
|
2057
|
+
if (this.blob) {
|
|
2058
|
+
URL.revokeObjectURL(this.blob);
|
|
2059
|
+
}
|
|
2052
2060
|
this.blob = URL.createObjectURL(e.target.files[0]);
|
|
2053
2061
|
//set base64 url
|
|
2054
2062
|
const reader = new FileReader();
|
|
@@ -2094,6 +2102,9 @@ class FigImage extends HTMLElement {
|
|
|
2094
2102
|
attributeChangedCallback(name, oldValue, newValue) {
|
|
2095
2103
|
if (name === "src") {
|
|
2096
2104
|
//this.src = newValue;
|
|
2105
|
+
if (!this.chit) {
|
|
2106
|
+
this.chit = this.querySelector("fig-chit");
|
|
2107
|
+
}
|
|
2097
2108
|
if (this.chit) {
|
|
2098
2109
|
this.chit.setAttribute("src", this.#src);
|
|
2099
2110
|
}
|