From fb4f708370dd164c4e55c80f698b15614f97a67f Mon Sep 17 00:00:00 2001 From: soufiane Date: Thu, 7 Aug 2025 14:38:36 +0200 Subject: [PATCH] wait #7682 @0:15 --- .../markdowneditor/js/markdowneditor.zoom.js | 16 ++++++++-------- resources/markdowneditor/style/style.sass | 3 +++ 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/resources/markdowneditor/js/markdowneditor.zoom.js b/resources/markdowneditor/js/markdowneditor.zoom.js index 6eed8b0c1..9cc7adcaf 100644 --- a/resources/markdowneditor/js/markdowneditor.zoom.js +++ b/resources/markdowneditor/js/markdowneditor.zoom.js @@ -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; } diff --git a/resources/markdowneditor/style/style.sass b/resources/markdowneditor/style/style.sass index ca463a464..5cff6cab9 100644 --- a/resources/markdowneditor/style/style.sass +++ b/resources/markdowneditor/style/style.sass @@ -1,3 +1,6 @@ +html + touch-action: none + * box-sizing: border-box -- 2.39.5