1
0
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:
Steve-Mcl 2021-04-29 17:31:38 +01:00
parent 37ba409dc3
commit abf084f6c2

View File

@ -216,11 +216,16 @@ RED.library = (function() {
{ id:'node-input-'+options.type+'-menu-open-library', { id:'node-input-'+options.type+'-menu-open-library',
label: RED._("library.openLibrary"), label: RED._("library.openLibrary"),
onselect: function() { onselect: function() {
var editorOpts = {
libraryEditor = ace.edit('red-ui-library-dialog-load-preview-text',{ id: 'red-ui-library-dialog-load-preview-text',
useWorker: false mode: options.mode,
}); readOnly: true,
libraryEditor.setTheme("ace/theme/tomorrow"); highlightActiveLine: false,
highlightGutterLine: false,
contextmenu: false
}
libraryEditor = RED.editor.createEditor(editorOpts); //use red.editor
if(libraryEditor.isACE) {
if (options.mode) { if (options.mode) {
libraryEditor.getSession().setMode(options.mode); libraryEditor.getSession().setMode(options.mode);
} }
@ -231,6 +236,7 @@ RED.library = (function() {
}); });
libraryEditor.renderer.$cursorLayer.element.style.opacity=0; libraryEditor.renderer.$cursorLayer.element.style.opacity=0;
libraryEditor.$blockScrolling = Infinity; libraryEditor.$blockScrolling = Infinity;
}
activeLibrary = options; activeLibrary = options;
var listing = []; var listing = [];