prevent exception if ace is missing

This commit is contained in:
Steve-Mcl 2021-04-29 16:59:11 +01:00
parent 60d97c887d
commit 71bdade7b9
2 changed files with 2 additions and 2 deletions

View File

@ -711,7 +711,7 @@ var RED = (function() {
throw new Error("RED already initialised"); throw new Error("RED already initialised");
} }
initialised = true; initialised = true;
ace.require("ace/ext/language_tools"); if(window.ace) { window.ace.require("ace/ext/language_tools"); }
options = options || {}; options = options || {};
options.apiRootUrl = options.apiRootUrl || ""; options.apiRootUrl = options.apiRootUrl || "";
if (options.apiRootUrl && !/\/$/.test(options.apiRootUrl)) { if (options.apiRootUrl && !/\/$/.test(options.apiRootUrl)) {

View File

@ -2850,7 +2850,7 @@ var buildingEditDialog = false;
return { return {
init: function() { init: function() {
ace.config.set('basePath', 'vendor/ace'); if(window.ace) { window.ace.config.set('basePath', 'vendor/ace'); }
RED.tray.init(); RED.tray.init();
RED.actions.add("core:confirm-edit-tray", function() { RED.actions.add("core:confirm-edit-tray", function() {
$(document.activeElement).blur(); $(document.activeElement).blur();