zoom in/out with Ctrl+wheel

pull/1/head
LianaHus 6 years ago
parent 45f3bcc7e2
commit d0bc62ceb9
  1. 7
      src/app/editor/editor.js

@ -78,6 +78,7 @@ class Editor {
// Editor Setup // Editor Setup
const el = yo`<div id="input"></div>` const el = yo`<div id="input"></div>`
this.editor = ace.edit(el) this.editor = ace.edit(el)
ace.acequire('ace/ext/language_tools') ace.acequire('ace/ext/language_tools')
// Unmap ctrl-l & cmd-l // Unmap ctrl-l & cmd-l
@ -134,6 +135,12 @@ class Editor {
} }
langTools.addCompleter(flowCompleter) langTools.addCompleter(flowCompleter)
// zoom with Ctrl+wheel
window.addEventListener("wheel", (e) => {
if (e.ctrlKey && Math.abs(e.wheelY) > 5)
this.editorFontSize(e.wheelY > 0 ? 1 : -1)
})
// EVENTS LISTENERS // EVENTS LISTENERS
// Gutter Mouse down // Gutter Mouse down

Loading…
Cancel
Save