@innovastudio/contentbuilder 1.4.136 → 1.4.138
Sign up to get free protection for your applications and to get access to all the features.
package/package.json
CHANGED
@@ -159,6 +159,7 @@ class Util {
|
|
159
159
|
e.preventDefault();
|
160
160
|
e.stopImmediatePropagation();
|
161
161
|
});
|
162
|
+
if (buttonok) buttonok.focus();
|
162
163
|
}
|
163
164
|
showRtePop(pop, onShow, btn) {
|
164
165
|
const dom = this.dom;
|
@@ -45836,6 +45837,7 @@ class Image$1 {
|
|
45836
45837
|
|
45837
45838
|
//Check if image is part of module snippet. If so, refresh the (active) module (hide imageTool). If not, refresh imageTool position
|
45838
45839
|
this.refreshIfIsModule(img);
|
45840
|
+
this.startImageMonitor(img);
|
45839
45841
|
|
45840
45842
|
//Trigger Change event
|
45841
45843
|
this.builder.opts.onChange();
|
@@ -46370,6 +46372,30 @@ class Image$1 {
|
|
46370
46372
|
this.builder.imgs = [];
|
46371
46373
|
} //constructor
|
46372
46374
|
|
46375
|
+
startImageMonitor(target) {
|
46376
|
+
let observer;
|
46377
|
+
const config = {
|
46378
|
+
attributes: true
|
46379
|
+
};
|
46380
|
+
observer = new MutationObserver(mutations => {
|
46381
|
+
mutations.forEach(mutation => {
|
46382
|
+
if (mutation.attributeName === 'src') {
|
46383
|
+
// console.log('Image Changed:' + target.src);
|
46384
|
+
|
46385
|
+
if (this.builder.onImageSrcChange) this.builder.onImageSrcChange();
|
46386
|
+
stopImageMonitor(); // Stop the monitor when the image changes
|
46387
|
+
}
|
46388
|
+
});
|
46389
|
+
});
|
46390
|
+
|
46391
|
+
observer.observe(target, config);
|
46392
|
+
function stopImageMonitor() {
|
46393
|
+
if (observer) {
|
46394
|
+
observer.disconnect();
|
46395
|
+
// console.log('Monitor Stopped');
|
46396
|
+
}
|
46397
|
+
}
|
46398
|
+
}
|
46373
46399
|
open() {
|
46374
46400
|
const movControlBox = document.querySelector('.moveable-control-box');
|
46375
46401
|
if (movControlBox) movControlBox.style.display = 'none'; //needed by Safari (prevent z-index problem)
|