Skip to content
This repository has been archived by the owner on Sep 13, 2024. It is now read-only.

Commit

Permalink
Merge pull request #248 from lvcabral/fix/menu-alignment
Browse files Browse the repository at this point in the history
Fixed: The submenus are not aligned with the title menu #247
  • Loading branch information
AlexTorresDev authored Dec 19, 2023
2 parents 338f1b6 + 2a7ffc5 commit 1c62abe
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/menubar/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1004,15 +1004,15 @@ export class MenuBar extends Disposable {
const actualMenuIndex = menuIndex >= this.numMenusShown ? MenuBar.OVERFLOW_INDEX : menuIndex
const customMenu = actualMenuIndex === MenuBar.OVERFLOW_INDEX ? this.overflowMenu : this.menus[actualMenuIndex]

if (!customMenu.actions || !customMenu.buttonElement || !customMenu.titleElement) {
if (!customMenu.actions || !customMenu.buttonElement) {
return
}

const menuHolder = $('.cet-menubar-menu-container', { title: '' })
customMenu.buttonElement.classList.add('open')

const titleBoundingRect = customMenu.titleElement.getBoundingClientRect()
const titleBoundingRectZoom = DOM.getDomNodeZoomLevel(customMenu.titleElement)
const titleBoundingRect = customMenu.buttonElement.getBoundingClientRect()
const titleBoundingRectZoom = DOM.getDomNodeZoomLevel(customMenu.buttonElement)

if (this.options.compactMode === Direction.Right) {
menuHolder.style.top = `${titleBoundingRect.top}px`
Expand Down

0 comments on commit 1c62abe

Please sign in to comment.