mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Dont call to ACE, re-use createEditor instead
This commit is contained in:
parent
37ba409dc3
commit
abf084f6c2
@ -216,11 +216,16 @@ RED.library = (function() {
|
||||
{ id:'node-input-'+options.type+'-menu-open-library',
|
||||
label: RED._("library.openLibrary"),
|
||||
onselect: function() {
|
||||
|
||||
libraryEditor = ace.edit('red-ui-library-dialog-load-preview-text',{
|
||||
useWorker: false
|
||||
});
|
||||
libraryEditor.setTheme("ace/theme/tomorrow");
|
||||
var editorOpts = {
|
||||
id: 'red-ui-library-dialog-load-preview-text',
|
||||
mode: options.mode,
|
||||
readOnly: true,
|
||||
highlightActiveLine: false,
|
||||
highlightGutterLine: false,
|
||||
contextmenu: false
|
||||
}
|
||||
libraryEditor = RED.editor.createEditor(editorOpts); //use red.editor
|
||||
if(libraryEditor.isACE) {
|
||||
if (options.mode) {
|
||||
libraryEditor.getSession().setMode(options.mode);
|
||||
}
|
||||
@ -231,6 +236,7 @@ RED.library = (function() {
|
||||
});
|
||||
libraryEditor.renderer.$cursorLayer.element.style.opacity=0;
|
||||
libraryEditor.$blockScrolling = Infinity;
|
||||
}
|
||||
|
||||
activeLibrary = options;
|
||||
var listing = [];
|
||||
|
Loading…
Reference in New Issue
Block a user