fix: only apply reorder on view header buttons

This commit is contained in:
Phillip Bronzel 2022-09-24 16:41:23 +02:00
parent 666c855527
commit 9047a0fb2a
4 changed files with 7 additions and 5 deletions

View file

@ -1,7 +1,7 @@
{
"id": "cmdr",
"name": "Commander",
"version": "0.2.0",
"version": "0.2.1",
"minAppVersion": "0.16.0",
"description": "Customize your workspace by adding commands /everywhere/.",
"author": "jsmorabito & phibr0",

View file

@ -1,6 +1,6 @@
{
"name": "cmdr",
"version": "0.2.0",
"version": "0.2.1",
"description": "Customize your workspace by adding commands /everywhere/.",
"main": "main.js",
"scripts": {

View file

@ -75,7 +75,7 @@ export default class RibbonManager extends CommandManagerBase {
this.addCommand(pair);
this.reorder();
};
if (this.plugin.settings.showAddCommand) this.ribbonEl.ribbonActionsEl?.append(this.addBtn);
if (this.plugin.settings.showAddCommand) app.workspace.onLayoutReady(() => this.ribbonEl.ribbonActionsEl?.append(this.addBtn));
}
// eslint-disable-next-line no-unused-vars

View file

@ -191,8 +191,10 @@
&:hover {
opacity: 1;
}
// place adder button to the left of commander-added buttons
order: -1001;
&.view-action {
// place adder button to the left of commander-added buttons
order: -1001;
}
}
.cmdr-page-header {