@@ -1290,6 +1290,16 @@ describe('ModeBar', function() {
1290
1290
expect ( style . fill ) . toBe ( color ) ;
1291
1291
}
1292
1292
1293
+ function getStyleRule ( ) {
1294
+ var uid = gd . _fullLayout . _uid ;
1295
+ var ownerNode = document . getElementById ( 'plotly.js-style-modebar-' + uid ) ;
1296
+ var styleSheets = document . styleSheets ;
1297
+ for ( var i = 0 ; i < styleSheets . length ; i ++ ) {
1298
+ var ss = styleSheets [ i ] ;
1299
+ if ( ss . ownerNode === ownerNode ) return ss ;
1300
+ }
1301
+ }
1302
+
1293
1303
it ( 'create an associated style element and destroy it on purge' , function ( done ) {
1294
1304
var styleSelector , style ;
1295
1305
Plotly . plot ( gd , [ ] , { } )
@@ -1337,16 +1347,6 @@ describe('ModeBar', function() {
1337
1347
} ) ;
1338
1348
1339
1349
it ( 'changes background color (displayModeBar: hover)' , function ( done ) {
1340
- function getStyleRule ( ) {
1341
- var uid = gd . _fullLayout . _uid ;
1342
- var ownerNode = document . getElementById ( 'plotly.js-style-modebar-' + uid ) ;
1343
- var styleSheets = document . styleSheets ;
1344
- for ( var i = 0 ; i < styleSheets . length ; i ++ ) {
1345
- var ss = styleSheets [ i ] ;
1346
- if ( ss . ownerNode === ownerNode ) return ss ;
1347
- }
1348
- }
1349
-
1350
1350
Plotly . plot ( gd , [ ] , { modebar : { bgcolor : colors [ 0 ] } } )
1351
1351
. then ( function ( ) {
1352
1352
style = window . getComputedStyle ( gd . _fullLayout . _modeBar . element ) ;
@@ -1364,16 +1364,6 @@ describe('ModeBar', function() {
1364
1364
} ) ;
1365
1365
1366
1366
it ( 'changes background color (displayModeBar: true)' , function ( done ) {
1367
- function getStyleRule ( ) {
1368
- var uid = gd . _fullLayout . _uid ;
1369
- var ownerNode = document . getElementById ( 'plotly.js-style-modebar-' + uid ) ;
1370
- var styleSheets = document . styleSheets ;
1371
- for ( var i = 0 ; i < styleSheets . length ; i ++ ) {
1372
- var ss = styleSheets [ i ] ;
1373
- if ( ss . ownerNode === ownerNode ) return ss ;
1374
- }
1375
- }
1376
-
1377
1367
Plotly . plot ( gd , [ ] , { modebar : { bgcolor : colors [ 0 ] } } , { displayModeBar : true } )
1378
1368
. then ( function ( ) {
1379
1369
style = window . getComputedStyle ( gd . _fullLayout . _modeBar . element ) ;
0 commit comments