File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -27,9 +27,11 @@ module.exports = function manageModeBar(gd) {
2727 context = gd . _context ,
2828 modeBar = fullLayout . _modeBar ;
2929
30- if ( ! context . displayModeBar && modeBar ) {
31- modeBar . destroy ( ) ;
32- delete fullLayout . _modeBar ;
30+ if ( ! context . displayModeBar ) {
31+ if ( modeBar ) {
32+ modeBar . destroy ( ) ;
33+ delete fullLayout . _modeBar ;
34+ }
3335 return ;
3436 }
3537
Original file line number Diff line number Diff line change @@ -290,6 +290,14 @@ describe('ModeBar', function() {
290290 } ) ;
291291
292292 it ( 'displays or not mode bar according to displayModeBar config arg' , function ( ) {
293+ var gd = getMockGraphInfo ( ) ;
294+ gd . _context . displayModeBar = false ;
295+
296+ manageModeBar ( gd ) ;
297+ expect ( gd . _fullLayout . _modeBar ) . not . toBeDefined ( ) ;
298+ } ) ;
299+
300+ it ( 'updates mode bar according to displayModeBar config arg' , function ( ) {
293301 var gd = getMockGraphInfo ( ) ;
294302 manageModeBar ( gd ) ;
295303 expect ( gd . _fullLayout . _modeBar ) . toBeDefined ( ) ;
You can’t perform that action at this time.
0 commit comments