Skip to content

Commit 8212e20

Browse files
committed
Added mouse wheel zoom
1 parent 3ac03d8 commit 8212e20

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

app/editor/boot.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -792,6 +792,17 @@ thin.init_ = function() {
792792
}
793793
});
794794

795+
// Mouse wheel zoom
796+
document.body.addEventListener('mousewheel', function(e){
797+
var workspace = thin.core.getActiveWorkspace();
798+
if(e.ctrlKey != true || !workspace) return;
799+
if(e.wheelDeltaY < 0) {
800+
workspace.getAction().actionSetZoom(workspace.getUiStatusForZoom() - 10);
801+
}else {
802+
workspace.getAction().actionSetZoom(workspace.getUiStatusForZoom() + 10);
803+
}
804+
})
805+
795806
// Zoom in
796807
var toolZoomIn = toolbar.setupChild('zoom-in',
797808
new thin.ui.ToolbarButton(thin.t('button_zoom_in'), new thin.ui.Icon('zoom-in')),

0 commit comments

Comments
 (0)