and put them back in that order on the next boot
This commit is contained in:
1 parent
8fc05b028f
commit
66ebfb5156
1 file changed
+10
@@ -6,6 +6,16 @@ module.exports = class RibbonOrderLock extends Plugin {
|
||||
|
||||
this.app.workspace.onLayoutReady(() => {
|
||||
const ribbon = this.app.workspace.leftRibbon;
|
||||
const order = this.settings.order;
|
||||
|
||||
const sorted = [...ribbon.items].sort(
|
||||
(a, b) => order.indexOf(a.id) - order.indexOf(b.id)
|
||||
);
|
||||
|
||||
ribbon.items.length = 0;
|
||||
ribbon.items.push(...sorted);
|
||||
ribbon.onChange(true);
|
||||
|
||||
this.settings.order = ribbon.items.map((item) => item.id);
|
||||
this.saveData(this.settings);
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user