$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;
}
return false;
}
- });
+ }, {passive: false});
$(document).on("click", "#markdown-preview", function(e) {
const centerX = ($this.container.scrollLeft() + $this.container.width() / 2) / $this.zoom;
if($this.zoomdragging) {
$this.zoomdragging = false
$this.setZoom(1)
- console.log()
$("#markdowneditor-zoom").css("cursor","zoom-in")
return false;
}