diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/library.js b/packages/node_modules/@node-red/editor-client/src/js/ui/library.js index 66e617229..21b925eba 100755 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/library.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/library.js @@ -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 = [];