Skip to content

Commit

Permalink
feat: 优化 menu 显示的位置
Browse files Browse the repository at this point in the history
  • Loading branch information
frostime committed Jul 12, 2023
1 parent 9a755d9 commit c3b893d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/components/toolbar-menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,11 @@ export class ToolbarMenuItem {
});

let rect = this.ele.getBoundingClientRect();
const iconIsRight = settings.get('IconPosition') === 'right';
menu.open({
x: rect.left,
x: iconIsRight ? rect.right : rect.left,
y: rect.bottom,
isLeft: settings.get('IconPosition') === 'right',
isLeft: iconIsRight,
})
event.stopPropagation();
}
Expand All @@ -102,10 +103,11 @@ export class ToolbarMenuItem {
if (isMobile) {
menu.fullscreen();
} else {
const iconIsRight = settings.get('IconPosition') === 'right';
menu.open({
x: rect.right,
x: iconIsRight ? rect.right : rect.left,
y: rect.bottom,
isLeft: settings.get('IconPosition') === 'right',
isLeft: iconIsRight,
});
}
// this.updateDailyNoteStatus();
Expand Down

0 comments on commit c3b893d

Please sign in to comment.