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,21 +216,27 @@ 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");
|
||||
if (options.mode) {
|
||||
libraryEditor.getSession().setMode(options.mode);
|
||||
}
|
||||
libraryEditor.setOptions({
|
||||
var editorOpts = {
|
||||
id: 'red-ui-library-dialog-load-preview-text',
|
||||
mode: options.mode,
|
||||
readOnly: true,
|
||||
highlightActiveLine: false,
|
||||
highlightGutterLine: false
|
||||
});
|
||||
libraryEditor.renderer.$cursorLayer.element.style.opacity=0;
|
||||
libraryEditor.$blockScrolling = Infinity;
|
||||
highlightGutterLine: false,
|
||||
contextmenu: false
|
||||
}
|
||||
libraryEditor = RED.editor.createEditor(editorOpts); //use red.editor
|
||||
if(libraryEditor.isACE) {
|
||||
if (options.mode) {
|
||||
libraryEditor.getSession().setMode(options.mode);
|
||||
}
|
||||
libraryEditor.setOptions({
|
||||
readOnly: true,
|
||||
highlightActiveLine: false,
|
||||
highlightGutterLine: false
|
||||
});
|
||||
libraryEditor.renderer.$cursorLayer.element.style.opacity=0;
|
||||
libraryEditor.$blockScrolling = Infinity;
|
||||
}
|
||||
|
||||
activeLibrary = options;
|
||||
var listing = [];
|
||||
|
Loading…
Reference in New Issue
Block a user