@@ -97,6 +97,9 @@ module.exports = function draw(gd) {
97
97
98
98
// remove exiting header, remove dropped buttons and reset margins
99
99
if ( headerGroups . enter ( ) . size ( ) ) {
100
+ // make sure gButton is on top of all headers
101
+ gButton . node ( ) . parentNode . appendChild ( gButton . node ( ) ) ;
102
+
100
103
gButton
101
104
. call ( removeAllButtons )
102
105
. attr ( constants . menuIndexAttrName , '-1' ) ;
@@ -135,13 +138,12 @@ module.exports = function draw(gd) {
135
138
} ) ;
136
139
} ;
137
140
141
+ /**
142
+ * get only visible menus for display
143
+ */
138
144
function 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 = [ ] ;
145
147
146
148
for ( var i = 0 ; i < contOpts . length ; i ++ ) {
147
149
var item = contOpts [ i ] ;
@@ -154,7 +156,7 @@ function makeMenuData(fullLayout) {
154
156
155
157
// Note that '_index' is set at the default step,
156
158
// 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,
158
160
// this is a more 'consistent' field than the index in the menuData.
159
161
function keyFunction ( menuOpts ) {
160
162
return menuOpts . _index ;
0 commit comments