Merge Modals.pluginSettings and Modals.themeSettings to a single function for both

This commit is contained in:
Samuel Elliott 2018-02-14 16:22:48 +00:00
parent 8c5796e4f6
commit dcb2704a28
No known key found for this signature in database
GPG Key ID: 8420C7CDE43DC4D6
5 changed files with 6 additions and 10 deletions

View File

@ -74,7 +74,7 @@ export default class Plugin {
}
showSettingsModal() {
return Modals.pluginSettings(this);
return Modals.contentSettings(this);
}
async saveSettings(newSettings) {

View File

@ -64,7 +64,7 @@ export default class Theme {
get events() { return this.EventEmitter ? this.EventEmitter : (this.EventEmitter = new ThemeEvents(this)) }
showSettingsModal() {
return Modals.themeSettings(this);
return Modals.contentSettings(this);
}
async saveSettings(newSettings) {

View File

@ -89,7 +89,7 @@
})();
},
showSettings(plugin) {
return Modals.pluginSettings(plugin);
return Modals.contentSettings(plugin);
}
}
}

View File

@ -89,7 +89,7 @@
})();
},
showSettings(theme) {
return Modals.themeSettings(theme);
return Modals.contentSettings(theme);
}
}
}

View File

@ -108,12 +108,8 @@ export default class {
return this.settings(set.headertext, set.settings, null, null, newSettings => Settings.saveSettings(set.id, newSettings));
}
static pluginSettings(plugin) {
return this.settings(plugin.name + ' Settings', plugin.config, null, null, plugin.saveSettings.bind(plugin));
}
static themeSettings(theme) {
return this.settings(theme.name + ' Settings', theme.config, null, null, theme.saveSettings.bind(theme));
static contentSettings(content) {
return this.settings(content.name + ' Settings', content.config, null, null, content.saveSettings.bind(content));
}
static get stack() {