fall back to a dom query in case ribbonItemsEl moves
This commit is contained in:
1 parent
afe4707c5a
commit
79770e59d3
1 file changed
+5
-1
@@ -35,10 +35,14 @@ module.exports = class RibbonOrderLock extends Plugin {
|
||||
return this.app.workspace.leftRibbon ?? null;
|
||||
}
|
||||
|
||||
getRibbonContainerEl(ribbon) {
|
||||
return ribbon.ribbonItemsEl ?? document.querySelector('.side-dock-ribbon.mod-left .side-dock-actions');
|
||||
}
|
||||
|
||||
observeRibbon() {
|
||||
const ribbon = this.getRibbon();
|
||||
if (!ribbon) return;
|
||||
const containerEl = ribbon.ribbonItemsEl;
|
||||
const containerEl = this.getRibbonContainerEl(ribbon);
|
||||
if (!containerEl) return;
|
||||
|
||||
this.observer = new MutationObserver(() => this.debouncedEnforce());
|
||||
|
||||
Reference in new issue
Block a user