Skip to content

Commit

Permalink
(mostly) re-enable library preview
Browse files Browse the repository at this point in the history
  • Loading branch information
Dave Conway-Jones authored and Dave Conway-Jones committed Jul 21, 2015
1 parent a2189e6 commit 30539c2
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions editor/js/ui/library.js
Expand Up @@ -132,7 +132,8 @@ RED.library = (function() {
$(this).addClass("list-selected");
$.get("library/"+options.url+root+item.fn, function(data) {
selectedLibraryItem = item;
libraryEditor.setValue(data,-1);
//libraryEditor.setValue(data,-1);
libraryEditor.setText(data);
});
}
})();
Expand All @@ -157,7 +158,8 @@ RED.library = (function() {
$("#node-select-library").children().remove();
var bc = $("#node-dialog-library-breadcrumbs");
bc.children().first().nextAll().remove();
libraryEditor.setValue('',-1);
//libraryEditor.setValue('',-1);
libraryEditor.setText('');

$.getJSON("library/"+options.url,function(data) {
$("#node-select-library").append(buildFileList("/",data));
Expand Down Expand Up @@ -218,7 +220,16 @@ RED.library = (function() {
e.preventDefault();
});

libraryEditor = options.editor;
RED.editor.createEditor({
id: 'node-select-library-text'
}, function(editorView) {
libraryEditor = editorView.editor;
//editorView.setContents(contents, 'application/javascript');
//libraryEditor.setText('node-select-library-text');
libraryEditor.getTextView().setOptions({themeClass: "editorTheme"});
libraryEditor.focus();
});

//libraryEditor = ace.edit('node-select-library-text');
//libraryEditor.setTheme("ace/theme/tomorrow");
//if (options.mode) {
Expand Down Expand Up @@ -247,7 +258,8 @@ RED.library = (function() {
var field = options.fields[i];
$("#node-input-"+field).val(selectedLibraryItem[field]);
}
options.editor.setValue(libraryEditor.getValue(),-1);
//options.editor.setValue(libraryEditor.getValue(),-1);
options.editor.setValue(libraryEditor.getText(),-1);
}
$( this ).dialog( "close" );
}
Expand Down

0 comments on commit 30539c2

Please sign in to comment.