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

Fixed: The submenus are not aligned with the title menu #247 #248

Merged
merged 3 commits into from
Dec 19, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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