@@ -979,27 +979,27 @@ export class MenuBar extends Disposable {
979
979
const actualMenuIndex = menuIndex >= this . numMenusShown ? MenuBar . OVERFLOW_INDEX : menuIndex ;
980
980
const customMenu = actualMenuIndex === MenuBar . OVERFLOW_INDEX ? this . overflowMenu : this . menus [ actualMenuIndex ] ;
981
981
982
- if ( ! customMenu . actions || ! customMenu . buttonElement ) {
982
+ if ( ! customMenu . actions || ! customMenu . buttonElement || ! customMenu . titleElement ) {
983
983
return ;
984
984
}
985
985
986
986
const menuHolder = $ ( 'div.menubar-menu-items-holder' , { 'title' : '' } ) ;
987
987
988
988
customMenu . buttonElement . classList . add ( 'open' ) ;
989
989
990
- const buttonBoundingRect = customMenu . buttonElement . getBoundingClientRect ( ) ;
991
- const buttonBoundingRectZoom = DOM . getDomNodeZoomLevel ( customMenu . buttonElement ) ;
990
+ const titleBoundingRect = customMenu . titleElement . getBoundingClientRect ( ) ;
991
+ const titleBoundingRectZoom = DOM . getDomNodeZoomLevel ( customMenu . titleElement ) ;
992
992
993
993
if ( this . options . compactMode === Direction . Right ) {
994
- menuHolder . style . top = `${ buttonBoundingRect . top } px` ;
995
- menuHolder . style . left = `${ buttonBoundingRect . left + this . container . clientWidth } px` ;
994
+ menuHolder . style . top = `${ titleBoundingRect . top } px` ;
995
+ menuHolder . style . left = `${ titleBoundingRect . left + this . container . clientWidth } px` ;
996
996
} else if ( this . options . compactMode === Direction . Left ) {
997
- menuHolder . style . top = `${ buttonBoundingRect . top } px` ;
997
+ menuHolder . style . top = `${ titleBoundingRect . top } px` ;
998
998
menuHolder . style . right = `${ this . container . clientWidth } px` ;
999
999
menuHolder . style . left = 'auto' ;
1000
1000
} else {
1001
- menuHolder . style . top = `${ buttonBoundingRect . bottom * buttonBoundingRectZoom } px` ;
1002
- menuHolder . style . left = `${ buttonBoundingRect . left * buttonBoundingRectZoom } px` ;
1001
+ menuHolder . style . top = `${ titleBoundingRect . bottom * titleBoundingRectZoom } px` ;
1002
+ menuHolder . style . left = `${ titleBoundingRect . left * titleBoundingRectZoom } px` ;
1003
1003
}
1004
1004
1005
1005
customMenu . buttonElement . appendChild ( menuHolder ) ;
0 commit comments