Merge Modals.pluginSettings and Modals.themeSettings to a single function for both
This commit is contained in:
parent
8c5796e4f6
commit
dcb2704a28
|
@ -74,7 +74,7 @@ export default class Plugin {
|
|||
}
|
||||
|
||||
showSettingsModal() {
|
||||
return Modals.pluginSettings(this);
|
||||
return Modals.contentSettings(this);
|
||||
}
|
||||
|
||||
async saveSettings(newSettings) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -89,7 +89,7 @@
|
|||
})();
|
||||
},
|
||||
showSettings(plugin) {
|
||||
return Modals.pluginSettings(plugin);
|
||||
return Modals.contentSettings(plugin);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -89,7 +89,7 @@
|
|||
})();
|
||||
},
|
||||
showSettings(theme) {
|
||||
return Modals.themeSettings(theme);
|
||||
return Modals.contentSettings(theme);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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() {
|
||||
|
|
Loading…
Reference in New Issue