From 52675f5bca830222beebb144b3e997df1ac4215a Mon Sep 17 00:00:00 2001 From: d11e9 Date: Mon, 7 Sep 2015 18:41:57 +0100 Subject: [PATCH] fix resize, must be called after editor is setup --- index.html | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/index.html b/index.html index ceb1ca6fdc..b953fe335b 100644 --- a/index.html +++ b/index.html @@ -257,7 +257,26 @@ input[readonly] { + + + // ----------------- editor ---------------------- + + var SOL_CACHE_KEY = "sol-cache"; + + var editor = ace.edit("input"); + var session = editor.getSession(); + var Range = ace.require('ace/range').Range; + var errMarkerId = null; + + var solCache = window.localStorage.getItem( SOL_CACHE_KEY ); + editor.setValue( solCache || BALLOT_EXAMPLE, 1 ); + + session.setMode("ace/mode/javascript"); + session.setTabSize(4); + session.setUseSoftTabs(true); + // ----------------- resizeable ui --------------- + var EDITOR_SIZE_CACHE_KEY = "editor-size-cache"; var dragging = false; $('#dragbar').mousedown(function(e){ @@ -298,22 +317,6 @@ input[readonly] { // set cached defaults var cachedSize = window.localStorage.getItem( EDITOR_SIZE_CACHE_KEY ); if (cachedSize) setEditorSize( cachedSize ); - - // ----------------- editor ---------------------- - - var SOL_CACHE_KEY = "sol-cache"; - - var editor = ace.edit("input"); - var session = editor.getSession(); - var Range = ace.require('ace/range').Range; - var errMarkerId = null; - - var solCache = window.localStorage.getItem( SOL_CACHE_KEY ); - editor.setValue( solCache || BALLOT_EXAMPLE, 1 ); - - session.setMode("ace/mode/javascript"); - session.setTabSize(4); - session.setUseSoftTabs(true); // ----------------- editor resize ---------------