mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Merge pull request #3732 from node-red/fix-monaco-default
Fix defaulting to monaco if settings does not contain codeEditor
This commit is contained in:
commit
b2bb656d30
@ -101,7 +101,10 @@ module.exports = {
|
||||
}
|
||||
themeSettings = null;
|
||||
theme = settings.editorTheme || {};
|
||||
themeContext.asset.vendorMonaco = ((theme.codeEditor || {}).lib === "monaco") ? "vendor/monaco/monaco-bootstrap.js" : "";
|
||||
themeContext.asset.vendorMonaco = "vendor/monaco/monaco-bootstrap.js"
|
||||
if (theme.codeEditor && theme.codeEditor.lib === 'ace') {
|
||||
themeContext.asset.vendorMonaco = ''
|
||||
}
|
||||
activeTheme = theme.theme;
|
||||
},
|
||||
|
||||
|
@ -51,7 +51,7 @@ describe("api/editor/theme", function () {
|
||||
context.should.have.a.property("asset");
|
||||
context.asset.should.have.a.property("red", "red/red.min.js");
|
||||
context.asset.should.have.a.property("main", "red/main.min.js");
|
||||
context.asset.should.have.a.property("vendorMonaco", "");
|
||||
context.asset.should.have.a.property("vendorMonaco", "vendor/monaco/monaco-bootstrap.js");
|
||||
|
||||
should.not.exist(theme.settings());
|
||||
});
|
||||
@ -69,16 +69,16 @@ describe("api/editor/theme", function () {
|
||||
}
|
||||
});
|
||||
|
||||
it("Adds monaco bootstrap when enabled", async function () {
|
||||
it("Does not add monaco bootstrap when ace selected", async function () {
|
||||
theme.init({
|
||||
editorTheme: {
|
||||
codeEditor: {
|
||||
lib: 'monaco'
|
||||
lib: 'ace'
|
||||
}
|
||||
}
|
||||
});
|
||||
var context = await theme.context();
|
||||
context.asset.should.have.a.property("vendorMonaco", "vendor/monaco/monaco-bootstrap.js");
|
||||
context.asset.should.have.a.property("vendorMonaco", "");
|
||||
});
|
||||
|
||||
it("picks up custom theme", async function () {
|
||||
|
Loading…
Reference in New Issue
Block a user