From 7caf4de2cf1095bce65386d4c1bc7df604a09ae6 Mon Sep 17 00:00:00 2001 From: Riyad Preukschas Date: Sat, 17 Nov 2012 15:28:32 +0100 Subject: [PATCH] Fix setting Ace mode --- app/views/tree/edit.html.haml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/views/tree/edit.html.haml b/app/views/tree/edit.html.haml index 638958e..d1d7bf8 100644 --- a/app/views/tree/edit.html.haml +++ b/app/views/tree/edit.html.haml @@ -19,8 +19,11 @@ = link_to "Cancel", project_tree_path(@project, @id), class: "btn cancel-btn", confirm: "Are you sure?" :javascript + var ace_mode = "#{@tree.language.try(:ace_mode)}"; var editor = ace.edit("editor"); - editor.getSession().setMode("ace/mode/javascript"); + if (ace_mode) { + editor.getSession().setMode('ace/mode/' + ace_mode); + } $(".save-btn").click(function(){ $("#file_content").val(editor.getValue()); -- libgit2 0.21.2