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',
|
{ 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,
|
||||||
});
|
|
||||||
libraryEditor.setTheme("ace/theme/tomorrow");
|
|
||||||
if (options.mode) {
|
|
||||||
libraryEditor.getSession().setMode(options.mode);
|
|
||||||
}
|
|
||||||
libraryEditor.setOptions({
|
|
||||||
readOnly: true,
|
readOnly: true,
|
||||||
highlightActiveLine: false,
|
highlightActiveLine: false,
|
||||||
highlightGutterLine: false
|
highlightGutterLine: false,
|
||||||
});
|
contextmenu: false
|
||||||
libraryEditor.renderer.$cursorLayer.element.style.opacity=0;
|
}
|
||||||
libraryEditor.$blockScrolling = Infinity;
|
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;
|
activeLibrary = options;
|
||||||
var listing = [];
|
var listing = [];
|
||||||
|
Loading…
Reference in New Issue
Block a user