Commit 8b7970f4 authored by Alex Beregszaszi's avatar Alex Beregszaszi

Remove dependency on divs in editor

parent 15b4cbef
...@@ -487,7 +487,7 @@ var run = function () { ...@@ -487,7 +487,7 @@ var run = function () {
// ----------------- editor resize --------------- // ----------------- editor resize ---------------
function onResize () { function onResize () {
editor.resize() editor.resize(document.querySelector('#editorWrap').checked)
reAdjust() reAdjust()
} }
window.onresize = onResize window.onresize = onResize
......
...@@ -95,10 +95,10 @@ function Editor () { ...@@ -95,10 +95,10 @@ function Editor () {
} }
} }
this.resize = function () { this.resize = function (useWrapMode) {
editor.resize() editor.resize()
var session = editor.getSession() var session = editor.getSession()
session.setUseWrapMode(document.querySelector('#editorWrap').checked) session.setUseWrapMode(useWrapMode)
if (session.getUseWrapMode()) { if (session.getUseWrapMode()) {
var characterWidth = editor.renderer.characterWidth var characterWidth = editor.renderer.characterWidth
var contentWidth = editor.container.ownerDocument.getElementsByClassName('ace_scroller')[0].clientWidth var contentWidth = editor.container.ownerDocument.getElementsByClassName('ace_scroller')[0].clientWidth
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment