This commit is contained in:
Samuel Elliott 2018-02-22 16:19:35 +00:00
parent ff3ef34784
commit df0f823f1d
No known key found for this signature in database
GPG Key ID: 8420C7CDE43DC4D6
3 changed files with 10 additions and 12 deletions

View File

@ -122,7 +122,7 @@ export default class {
} catch (err) {
this.errors.push(new ErrorEvent({
module: this.moduleName,
message: `Failed to unload ${dir}`,
message: `Failed to unload ${content.dirName}`,
err
}));
@ -295,10 +295,10 @@ export default class {
static findContent(wild, nonunique) {
if (this.isThisContent(wild)) return wild;
let content;
if (content = this.getContentById(wild)) return content;
if (content = this.getContentByDirName(wild)) return content;
if (content = this.getContentByPath(wild)) return content;
if (content = nonunique && this.getContentByName(wild)) return content;
content = this.getContentById(wild); if (content) return content;
content = this.getContentByDirName(wild); if (content) return content;
content = this.getContentByPath(wild); if (content) return content;
content = this.getContentByName(wild); if (content && nonunique) return content;
}
static getContentIndex(content) { return this.localContent.findIndex(c => c === content) }

View File

@ -11,6 +11,7 @@
import { Utils, FileUtils } from 'common';
import { Modals } from 'ui';
import { EventEmitter } from 'events';
import PluginManager from './pluginmanager';
import ContentConfig from './contentconfig';
import { SettingUpdatedEvent, SettingsUpdatedEvent } from 'structs';

View File

@ -53,7 +53,10 @@ export default class ThemeManager extends ContentManager {
}
static get unloadTheme() { return this.unloadContent }
static get reloadTheme() { return this.reloadContent }
static async reloadTheme(theme) {
theme = await this.reloadContent(theme);
theme.recompile();
}
static enableTheme(theme) {
theme.enable();
@ -63,12 +66,6 @@ export default class ThemeManager extends ContentManager {
theme.disable();
}
static get unloadTheme() { return this.unloadContent }
static async reloadTheme(theme) {
theme = await this.reloadContent(theme);
theme.recompile();
}
static get isTheme() { return this.isThisContent }
static isThisContent(theme) {
return theme instanceof Theme;