fall back to a dom query in case ribbonItemsEl moves

This commit is contained in:
bdeshi committed 2026-07-19 23:01:04 +06:00
1 parent afe4707c5a
commit 79770e59d3
1 file changed
+5 -1
+5 -1
View File
@@ -35,10 +35,14 @@ module.exports = class RibbonOrderLock extends Plugin {
return this.app.workspace.leftRibbon ?? null; return this.app.workspace.leftRibbon ?? null;
} }
getRibbonContainerEl(ribbon) {
return ribbon.ribbonItemsEl ?? document.querySelector('.side-dock-ribbon.mod-left .side-dock-actions');
}
observeRibbon() { observeRibbon() {
const ribbon = this.getRibbon(); const ribbon = this.getRibbon();
if (!ribbon) return; if (!ribbon) return;
const containerEl = ribbon.ribbonItemsEl; const containerEl = this.getRibbonContainerEl(ribbon);
if (!containerEl) return; if (!containerEl) return;
this.observer = new MutationObserver(() => this.debouncedEnforce()); this.observer = new MutationObserver(() => this.debouncedEnforce());