@innovastudio/contentbox 1.2.28 → 1.2.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@innovastudio/contentbox",
3
- "version": "1.2.28",
3
+ "version": "1.2.29",
4
4
  "type": "module",
5
5
  "description": "",
6
6
  "main": "public/contentbox/contentbox.esm.js",
@@ -9143,14 +9143,20 @@ class EditBox {
9143
9143
  const chkBoxBgImageGrayscale = modalEditBox.querySelector('.chk-box-bgimage-grayscale');
9144
9144
  chkBoxBgImageGrayscale.addEventListener('click', () => {
9145
9145
  const activeBox = this.builder.activeBox;
9146
+ const overlay = activeBox.querySelector('.is-overlay');
9146
9147
  const overlayBg = activeBox.querySelector('.is-overlay-bg');
9147
9148
 
9148
9149
  if (chkBoxBgImageGrayscale.checked) {
9149
9150
  overlayBg.style.filter = 'grayscale(1)';
9151
+ overlay.style.filter = 'grayscale(1)';
9150
9152
  } else {
9151
9153
  if (overlayBg.style.filter) {
9152
9154
  overlayBg.style.filter = overlayBg.style.filter.replace('grayscale(1)', '');
9153
9155
  }
9156
+
9157
+ if (overlay.style.filter) {
9158
+ overlay.style.filter = overlay.style.filter.replace('grayscale(1)', '');
9159
+ }
9154
9160
  }
9155
9161
  });
9156
9162
  const chkBoxAddText = modalEditBox.querySelector('.cmd-box-addtext');
@@ -9444,6 +9450,7 @@ class EditBox {
9444
9450
  const builderStuff = this.builderStuff;
9445
9451
  const modalEditBox = builderStuff.querySelector('.is-modal.editbox');
9446
9452
  const activeBox = this.builder.activeBox;
9453
+ let overlay = activeBox.querySelector('.is-overlay');
9447
9454
  const overlayBg = activeBox.querySelector('.is-overlay-bg');
9448
9455
  const overlayVideo = activeBox.querySelector('.is-video-bg');
9449
9456
  const overlayContent = activeBox.querySelector('.is-overlay-content');
@@ -9718,10 +9725,21 @@ class EditBox {
9718
9725
  if (url !== '') {
9719
9726
  divPreview.innerHTML = `<img src="${url}">`;
9720
9727
 
9728
+ if (overlay) {
9729
+ if (overlay.style.filter) {
9730
+ if (overlay.style.filter.indexOf('grayscale') !== -1) {
9731
+ chkImageGrayscale.checked = true;
9732
+ }
9733
+ }
9734
+ }
9735
+
9721
9736
  if (overlayBg) {
9722
9737
  if (overlayBg.style.filter) {
9723
9738
  if (overlayBg.style.filter.indexOf('grayscale') !== -1) {
9724
9739
  chkImageGrayscale.checked = true;
9740
+ overlay.style.filter = 'grayscale(1)'; // change filter from -is-overlay-bg to is-overlay (to prevent conflict with animation)
9741
+
9742
+ overlayBg.style.filter = overlayBg.style.filter.replace('grayscale(1)', '');
9725
9743
  }
9726
9744
  }
9727
9745
  }
@@ -9755,8 +9773,6 @@ class EditBox {
9755
9773
  } // FIX OLD VERSION
9756
9774
 
9757
9775
 
9758
- let overlay = activeBox.querySelector('.is-overlay');
9759
-
9760
9776
  if (overlay) ; else {
9761
9777
  activeBox.insertAdjacentHTML('afterbegin', '<div class="is-overlay"></div>');
9762
9778
  overlay = activeBox.querySelector('.is-overlay');