Skip to content

Commit

Permalink
fix: only apply reorder on view header buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
phibr0 committed Sep 24, 2022
1 parent 666c855 commit 9047a0f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion src/manager/commands/ribbonManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions src/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 9047a0f

Please sign in to comment.