Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit fcdf05a

Browse filesBrowse files
committed
generalize is-active modebar update,
- using nested property to dive into fullLayout
1 parent 089b335 commit fcdf05a
Copy full SHA for fcdf05a

File tree

Expand file treeCollapse file tree

1 file changed

+8
-3
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+8
-3
lines changed

‎src/components/modebar/index.js

Copy file name to clipboardExpand all lines: src/components/modebar/index.js
+8-3Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@
99

1010
'use strict';
1111

12-
var Plotly = require('../../plotly');
1312
var d3 = require('d3');
1413

14+
var Plotly = require('../../plotly');
15+
var Lib = require('../../lib');
1516
var Icons = require('../../../build/ploticon');
1617

1718

@@ -204,7 +205,11 @@ proto.updateActiveButton = function(buttonClicked) {
204205
}
205206
}
206207
else {
207-
button3.classed('active', fullLayout[dataAttr]===thisval);
208+
var val = (dataAttr === null) ?
209+
dataAttr :
210+
Lib.nestedProperty(fullLayout, dataAttr).get();
211+
212+
button3.classed('active', val === thisval);
208213
}
209214

210215
});
@@ -260,7 +265,7 @@ proto.removeAllButtons = function() {
260265
};
261266

262267
proto.destroy = function() {
263-
Plotly.Lib.removeElement(this.container.querySelector('.modebar'));
268+
Lib.removeElement(this.container.querySelector('.modebar'));
264269
};
265270

266271
function createModeBar(gd, buttons) {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.