]> _ Git - fluidbook-toolbox.git/commitdiff
wait #7682 @0:15
authorsoufiane <soufiane@cubedesigners.com>
Thu, 7 Aug 2025 12:38:36 +0000 (14:38 +0200)
committersoufiane <soufiane@cubedesigners.com>
Thu, 7 Aug 2025 12:38:36 +0000 (14:38 +0200)
resources/markdowneditor/js/markdowneditor.zoom.js
resources/markdowneditor/style/style.sass

index 6eed8b0c19e2ba01b7c97964de5eb1d1fef05320..9cc7adcafa350633c92926acb1177941cc247bcd 100644 (file)
@@ -30,18 +30,19 @@ MarkdowneditorZoom.prototype = {
             $this.ctrl = false
         })
 
-        $("#markdown-preview").on('mousewheel', function (e) {
-            e.stopPropagation();
+        window.addEventListener('wheel', function (e) {
             if($this.ctrl) {
-
+                e.stopPropagation();
+                e.stopImmediatePropagation();
+                e.preventDefault();
                 var step = $this.zoom >= 1 ? 0.25 : 0.1;
-                $this.setMouseCoordinates(e);
-                let cursorPositionOnFluidbookBeforeZoom = $this.getFluidbookPositionOfCursor();
 
                 const centerX = ($this.container.scrollLeft() + $this.container.width() / 2) / $this.zoom;
                 const centerY = ($this.container.scrollTop() + $this.container.height() / 2) / $this.zoom;
 
-                let delta = e.originalEvent.deltaY;
+                console.log(e)
+
+                let delta = e.deltaY;
                 if (delta === 0) {
                     return true;
                 }
@@ -56,7 +57,7 @@ MarkdowneditorZoom.prototype = {
 
                 return false;
             }
-        });
+        }, {passive: false});
 
         $(document).on("click", "#markdown-preview", function(e) {
             const centerX = ($this.container.scrollLeft() + $this.container.width() / 2) / $this.zoom;
@@ -67,7 +68,6 @@ MarkdowneditorZoom.prototype = {
             if($this.zoomdragging) {
                 $this.zoomdragging = false
                 $this.setZoom(1)
-                console.log()
                 $("#markdowneditor-zoom").css("cursor","zoom-in")
                 return false;
             }
index ca463a4644a0f05ed7e3454fc30fb911f7885b2c..5cff6cab9b1a8b7cb2cb474146547203ca0cc412 100644 (file)
@@ -1,3 +1,6 @@
+html
+    touch-action: none
+
 *
     box-sizing: border-box