Fix setting Ace mode
This commit is contained in:
parent
6c1b44859d
commit
7caf4de2cf
|
@ -19,8 +19,11 @@
|
||||||
= link_to "Cancel", project_tree_path(@project, @id), class: "btn cancel-btn", confirm: "Are you sure?"
|
= link_to "Cancel", project_tree_path(@project, @id), class: "btn cancel-btn", confirm: "Are you sure?"
|
||||||
|
|
||||||
:javascript
|
:javascript
|
||||||
|
var ace_mode = "#{@tree.language.try(:ace_mode)}";
|
||||||
var editor = ace.edit("editor");
|
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(){
|
$(".save-btn").click(function(){
|
||||||
$("#file_content").val(editor.getValue());
|
$("#file_content").val(editor.getValue());
|
||||||
|
|
Loading…
Reference in a new issue