From c931df94a06ae346669965a3073131d03ebea6eb Mon Sep 17 00:00:00 2001 From: Benjamin ter Kuile Date: Sat, 7 Mar 2015 17:11:19 +0100 Subject: [PATCH] Fix ace value setting --- app/assets/javascripts/cmtool/html_edit.js.coffee | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/cmtool/html_edit.js.coffee b/app/assets/javascripts/cmtool/html_edit.js.coffee index 2adc4c2..7aafb0e 100644 --- a/app/assets/javascripts/cmtool/html_edit.js.coffee +++ b/app/assets/javascripts/cmtool/html_edit.js.coffee @@ -3,13 +3,14 @@ class HtmlEdit #ACE $('.html-content').each (i, el)-> text_field = $(el) - ace_div = $('
').addClass('ace-div').html(text_field.val()) + ace_div = $('
').addClass('ace-div') text_field.after ace_div ace_div.css width: '100%' height: '600px' editor = ace.edit(ace_div.get(0)) editor.setTheme 'ace/theme/monokai' + editor.setValue text_field.val(), -1 editor.getSession().setMode 'ace/mode/handlebars' editor.getSession().setTabSize(2) editor.getSession().setUseSoftTabs(true)