get that out of onload
This commit is contained in:
1 parent
66ebfb5156
commit
219491ec2b
1 file changed
+5
-1
@@ -5,6 +5,11 @@ module.exports = class RibbonOrderLock extends Plugin {
|
|||||||
this.settings = Object.assign({ order: [] }, await this.loadData());
|
this.settings = Object.assign({ order: [] }, await this.loadData());
|
||||||
|
|
||||||
this.app.workspace.onLayoutReady(() => {
|
this.app.workspace.onLayoutReady(() => {
|
||||||
|
this.enforceOrder();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
enforceOrder() {
|
||||||
const ribbon = this.app.workspace.leftRibbon;
|
const ribbon = this.app.workspace.leftRibbon;
|
||||||
const order = this.settings.order;
|
const order = this.settings.order;
|
||||||
|
|
||||||
@@ -18,6 +23,5 @@ module.exports = class RibbonOrderLock extends Plugin {
|
|||||||
|
|
||||||
this.settings.order = ribbon.items.map((item) => item.id);
|
this.settings.order = ribbon.items.map((item) => item.id);
|
||||||
this.saveData(this.settings);
|
this.saveData(this.settings);
|
||||||
});
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
Reference in new issue
Block a user