Skip to content

Commit 212612b

Browse files
committed
specify default style in modebar tests
1 parent 947eaf2 commit 212612b

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/components/modebar/modebar.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -163,11 +163,11 @@ proto.createButton = function(config) {
163163
if(config.toggle) d3.select(button).classed('active', true);
164164

165165
var icon = config.icon;
166-
if(config.color) icon.color = config.color;
167166
if(typeof icon === 'function') {
168167
button.appendChild(icon());
169168
}
170169
else {
170+
if(icon) icon.color = config.color;
171171
button.appendChild(this.createIcon(icon || Icons.question));
172172
}
173173
button.setAttribute('data-gravity', config.gravity || 'n');

test/jasmine/tests/modebar_test.js

+5
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ describe('ModeBar', function() {
3838
_context: {
3939
displaylogo: true,
4040
displayModeBar: true,
41+
modeBarStyle: {
42+
orientation: 'h',
43+
bgcolor: 'rgba(255,255,255,0.7)',
44+
iconColor: 'rgba(0, 31, 95, 0.3)'
45+
},
4146
modeBarButtonsToRemove: [],
4247
modeBarButtonsToAdd: [],
4348
locale: 'en',

0 commit comments

Comments
 (0)