watch for icons that load in after startup

This commit is contained in:
2026-06-13 01:50:22 +06:00
parent ef8fbfced9
commit b5f2c62676
+9
View File
@@ -7,9 +7,18 @@ module.exports = class RibbonOrderLock extends Plugin {
this.app.workspace.onLayoutReady(() => {
this.patchRibbon();
this.enforceOrder();
this.observeRibbon();
});
}
observeRibbon() {
const ribbon = this.app.workspace.leftRibbon;
const containerEl = ribbon.ribbonItemsEl;
this.observer = new MutationObserver(() => this.enforceOrder());
this.observer.observe(containerEl, { childList: true });
}
// hook the ribbon's own onChange so drags and hide/show toggles update
// our saved order automatically, same as Obsidian's native reorder does
patchRibbon() {