diff --git a/app/assets/javascripts/cmtool/html_edit.js.coffee b/app/assets/javascripts/cmtool/html_edit.js.coffee index 4d200d2..2330e50 100644 --- a/app/assets/javascripts/cmtool/html_edit.js.coffee +++ b/app/assets/javascripts/cmtool/html_edit.js.coffee @@ -14,9 +14,11 @@ class HtmlEdit if template_field.length editor.setValue template_field.val(), -1 editor.getSession().setMode 'ace/mode/haml' + console.log "Editing haml" else editor.setValue text_field.val(), -1 editor.getSession().setMode 'ace/mode/handlebars' + console.log "Editing handlebars" editor.getSession().setTabSize(2) editor.getSession().setUseSoftTabs(true) editor.getSession().on 'change', (e)-> diff --git a/app/assets/javascripts/cmtool/yml_edit.js.coffee b/app/assets/javascripts/cmtool/yml_edit.js.coffee index 4782e72..0ecc12b 100644 --- a/app/assets/javascripts/cmtool/yml_edit.js.coffee +++ b/app/assets/javascripts/cmtool/yml_edit.js.coffee @@ -3,7 +3,7 @@ class YmlEdit #ACE $('.yml-content').each (i, el)-> text_field = $(el) - ace_div = $('
').addClass('ace-div').html(text_field.val()) + ace_div = $('
').addClass('ace-div') #.html(text_field.val()) text_field.after ace_div ace_div.css width: '100%' @@ -11,6 +11,7 @@ class YmlEdit editor = ace.edit(ace_div.get(0)) editor.setTheme 'ace/theme/monokai' editor.getSession().setMode 'ace/mode/yaml' + editor.getSession().setValue text_field.val() editor.getSession().setTabSize(2) editor.getSession().setUseSoftTabs(true) editor.getSession().on 'change', (e)-> diff --git a/app/views/cmtool/yml_files/index.html.slim b/app/views/cmtool/yml_files/index.html.slim index c9cf3c6..0ac1ca0 100644 --- a/app/views/cmtool/yml_files/index.html.slim +++ b/app/views/cmtool/yml_files/index.html.slim @@ -9,7 +9,7 @@ tbody - @yml_files.each do |yml_file| tr - td= link_to yml_file.name, cmtool.yml_file_path(yml_file) + td= link_to yml_file.name, cmtool.edit_yml_file_path(yml_file) = edit_td yml_file = destroy_td yml_file - else