Skip to content

Commit

Permalink
Prevent menu offscreen w/over-full status bar
Browse files Browse the repository at this point in the history
  • Loading branch information
pjeby committed Aug 10, 2024
1 parent 2ddfa4f commit 7a8b462
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "Quick Explorer",
"author": "PJ Eby",
"authorUrl": "https://github.com/pjeby",
"version": "0.2.9",
"version": "0.2.10",
"description": "Perform file explorer operations (and see your current file path) from the title bar, using the mouse or keyboard",
"minAppVersion": "1.5.8",
"isDesktopOnly": true
Expand Down
2 changes: 1 addition & 1 deletion src/menus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ export class PopupMenu extends (Menu as new (app: App) => Menu) { // XXX fixme w

cascade(target: HTMLElement, event?: MouseEvent, onClose?: () => any, hOverlap = 15, vOverlap = 5) {
const {left, top, bottom, width} = target.getBoundingClientRect();
const centerX = left + (target.matchParent(".menu") ? Math.min(150, width/3) : 0);
const centerX = Math.max(0, left + (target.matchParent(".menu") ? Math.min(150, width/3) : 0));
const win = window.activeWindow ?? window, {innerHeight, innerWidth} = win;

// Try to cascade down and to the right from the mouse or horizontal center
Expand Down
2 changes: 1 addition & 1 deletion versions.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"0.2.9": "1.5.8",
"0.2.10": "1.5.8",
"0.2.8": "0.15.9",
"0.1.41": "0.15.9",
"0.1.37": "0.14.5",
Expand Down

0 comments on commit 7a8b462

Please sign in to comment.