Fix plugin API basic modals
This commit is contained in:
parent
68c0133381
commit
e7b0acb5a0
|
@ -264,7 +264,6 @@ export default class PluginApi {
|
||||||
}
|
}
|
||||||
addModal(_modal, component) {
|
addModal(_modal, component) {
|
||||||
const modal = Modals.add(_modal, component);
|
const modal = Modals.add(_modal, component);
|
||||||
modal.close = force => this.closeModal(modal, force);
|
|
||||||
modal.on('close', () => {
|
modal.on('close', () => {
|
||||||
let index;
|
let index;
|
||||||
while ((index = this.modalStack.findIndex(m => m === modal)) > -1)
|
while ((index = this.modalStack.findIndex(m => m === modal)) > -1)
|
||||||
|
@ -298,6 +297,7 @@ export default class PluginApi {
|
||||||
close: this.closeModal.bind(this),
|
close: this.closeModal.bind(this),
|
||||||
closeAll: this.closeAllModals.bind(this),
|
closeAll: this.closeAllModals.bind(this),
|
||||||
closeLast: this.closeLastModal.bind(this),
|
closeLast: this.closeLastModal.bind(this),
|
||||||
|
basic: this.basicModal.bind(this),
|
||||||
settings: this.settingsModal.bind(this)
|
settings: this.settingsModal.bind(this)
|
||||||
}, 'stack', {
|
}, 'stack', {
|
||||||
get: () => this.modalStack
|
get: () => this.modalStack
|
||||||
|
|
|
@ -46,7 +46,8 @@ export default class Theme extends Content {
|
||||||
/**
|
/**
|
||||||
* This is called when the theme is enabled.
|
* This is called when the theme is enabled.
|
||||||
*/
|
*/
|
||||||
onstart() {
|
async onstart() {
|
||||||
|
if (!this.css) await this.recompile();
|
||||||
DOM.injectTheme(this.css, this.id);
|
DOM.injectTheme(this.css, this.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -48,7 +48,6 @@ export default class ThemeManager extends ContentManager {
|
||||||
if (instance.enabled) {
|
if (instance.enabled) {
|
||||||
instance.userConfig.enabled = false;
|
instance.userConfig.enabled = false;
|
||||||
instance.enable();
|
instance.enable();
|
||||||
if (!instance.css) instance.recompile();
|
|
||||||
}
|
}
|
||||||
return instance;
|
return instance;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|
|
@ -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() {
|
async onstart() {
|
||||||
// Some array event examples
|
// Some array event examples
|
||||||
const arraySetting = this.settings.getSetting('default', 'array-1');
|
const arraySetting = this.settings.getSetting('default', 'array-1');
|
||||||
|
|
Loading…
Reference in New Issue