@@ -97,6 +97,9 @@ module.exports = function draw(gd) {
9797
9898 // remove exiting header, remove dropped buttons and reset margins
9999 if ( headerGroups . enter ( ) . size ( ) ) {
100+ // make sure gButton is on top of all headers
101+ gButton . node ( ) . parentNode . appendChild ( gButton . node ( ) ) ;
102+
100103 gButton
101104 . call ( removeAllButtons )
102105 . attr ( constants . menuIndexAttrName , '-1' ) ;
@@ -135,13 +138,12 @@ module.exports = function draw(gd) {
135138 } ) ;
136139} ;
137140
141+ /**
142+ * get only visible menus for display
143+ */
138144function makeMenuData ( fullLayout ) {
139- var contOpts = fullLayout [ constants . name ] ,
140- menuData = [ ] ;
141-
142- // Filter visible dropdowns and attach '_index' to each
143- // fullLayout options object to be used for 'object constancy'
144- // in the data join key function.
145+ var contOpts = fullLayout [ constants . name ] ;
146+ var menuData = [ ] ;
145147
146148 for ( var i = 0 ; i < contOpts . length ; i ++ ) {
147149 var item = contOpts [ i ] ;
@@ -154,7 +156,7 @@ function makeMenuData(fullLayout) {
154156
155157// Note that '_index' is set at the default step,
156158// it corresponds to the menu index in the user layout update menu container.
157- // Because a menu can b set invisible,
159+ // Because a menu can be set invisible,
158160// this is a more 'consistent' field than the index in the menuData.
159161function keyFunction ( menuOpts ) {
160162 return menuOpts . _index ;
0 commit comments