Fix issues removing settings panels

Closes #627
This commit is contained in:
Zack Rauen 2021-04-02 23:49:32 -04:00
parent b739fc6f38
commit a33279ea71
2 changed files with 23 additions and 28 deletions

View File

@ -26,13 +26,7 @@ export default new class CustomCSS extends Builtin {
}
async enabled() {
// if (!window.ace) {
// DOMManager.injectScript("ace-script", "https://cdnjs.cloudflare.com/ajax/libs/ace/1.2.9/ace.js").then(() => {
// if (window.require.original) window.require = window.require.original;
// });
// }
if (!window.monaco && !window.MonacoEnvironment) {
Object.defineProperty(window, "MonacoEnvironment", {
value: {
getWorkerUrl: function() {
@ -54,9 +48,10 @@ export default new class CustomCSS extends Builtin {
const amdLoader = window.require; // Grab Monaco's amd loader
window.require = commonjsLoader; // Revert to commonjs
this.log(amdLoader, window.require);
// this.log(amdLoader, window.require);
amdLoader.config({paths: {vs: "https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.20.0/min/vs"}});
amdLoader(["vs/editor/editor.main"], () => {}); // exposes the monaco global
}
Settings.registerPanel(this.id, Strings.Panels.customcss, {
order: 2,

View File

@ -52,7 +52,7 @@ export default new class SettingsManager {
removePanel(id) {
const location = this.panels.findIndex(c => c.id == id);
if (!location < 0) return Logger.error("Settings", "No collection with id " + id);
if (location < 0) return Logger.error("Settings", "No collection with id " + id);
this.panels.splice(location, 1);
}