@websline/cms-view-utils 0.14.0 → 0.16.0

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": "@websline/cms-view-utils",
3
- "version": "0.14.0",
3
+ "version": "0.16.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./src/index.js"
@@ -38,7 +38,7 @@
38
38
  display: none;
39
39
  color: inherit;
40
40
  position: absolute;
41
- top: 0;
41
+ top: -5px;
42
42
  left: 0;
43
43
  overflow: hidden;
44
44
  transform: translate(0, -100%);
@@ -38,6 +38,11 @@ const enableEditBlocks = () => {
38
38
 
39
39
  editBlocks.forEach((el) => {
40
40
  el.addEventListener("mouseover", () => {
41
+ // check if dragging is in progress
42
+ if (document.body.classList.contains("cms-editor-is-dragging")) {
43
+ return;
44
+ }
45
+
41
46
  clearTimeout(timeoutId);
42
47
 
43
48
  if (activeBlock && activeBlock !== el) {
@@ -43,6 +43,7 @@ class IframeDragHandler {
43
43
  this.addMouseFollowerHandler();
44
44
  this.highlightDropzone();
45
45
  this.addDropListeners();
46
+ this.addDraggingClass();
46
47
  window.addEventListener("scroll", this.handleScroll, true);
47
48
  }
48
49
 
@@ -52,6 +53,7 @@ class IframeDragHandler {
52
53
  this.removeMouseFollowerHandler();
53
54
  this.unhighlightDropzone();
54
55
  this.removeDropListeners();
56
+ this.removeDraggingClass();
55
57
  window.removeEventListener("scroll", this.handleScroll, true);
56
58
  this.lastMouseEvent = null;
57
59
  }
@@ -205,6 +207,14 @@ class IframeDragHandler {
205
207
  dropzone.classList.remove("highlight");
206
208
  });
207
209
  }
210
+
211
+ addDraggingClass() {
212
+ document.body.classList.add("cms-editor-is-dragging");
213
+ }
214
+
215
+ removeDraggingClass() {
216
+ document.body.classList.remove("cms-editor-is-dragging");
217
+ }
208
218
  }
209
219
 
210
220
  export default IframeDragHandler;