Fix plugin API basic modals

This commit is contained in:
Samuel Elliott 2018-03-08 13:59:19 +00:00
parent 68c0133381
commit e7b0acb5a0
No known key found for this signature in database
GPG Key ID: 8420C7CDE43DC4D6
4 changed files with 4 additions and 4 deletions

View File

@ -264,7 +264,6 @@ export default class PluginApi {
}
addModal(_modal, component) {
const modal = Modals.add(_modal, component);
modal.close = force => this.closeModal(modal, force);
modal.on('close', () => {
let index;
while ((index = this.modalStack.findIndex(m => m === modal)) > -1)
@ -298,6 +297,7 @@ export default class PluginApi {
close: this.closeModal.bind(this),
closeAll: this.closeAllModals.bind(this),
closeLast: this.closeLastModal.bind(this),
basic: this.basicModal.bind(this),
settings: this.settingsModal.bind(this)
}, 'stack', {
get: () => this.modalStack

View File

@ -46,7 +46,8 @@ export default class Theme extends Content {
/**
* This is called when the theme is enabled.
*/
onstart() {
async onstart() {
if (!this.css) await this.recompile();
DOM.injectTheme(this.css, this.id);
}

View File

@ -48,7 +48,6 @@ export default class ThemeManager extends ContentManager {
if (instance.enabled) {
instance.userConfig.enabled = false;
instance.enable();
if (!instance.css) instance.recompile();
}
return instance;
} catch (err) {

View File

@ -1,4 +1,4 @@
module.exports = (Plugin, { Logger, Settings, BdMenu: { BdMenuItems }, Api }) => class extends Plugin {
module.exports = (Plugin, { Logger, Settings, Modals, BdMenu: { BdMenuItems }, Api }) => class extends Plugin {
async onstart() {
// Some array event examples
const arraySetting = this.settings.getSetting('default', 'array-1');