Skip to content

Commit fc47c72

Browse files
committed
remove 🐫 in modebar layout attributes
1 parent f9e8777 commit fc47c72

File tree

4 files changed

+16
-15
lines changed

4 files changed

+16
-15
lines changed

src/components/modebar/modebar.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,15 @@ proto.update = function(graphInfo, buttons) {
5757
}
5858
else this.element.className = 'modebar';
5959

60-
if(fullLayout.modeBarStyle.orientation === 'v') {
60+
if(fullLayout.modebar.orientation === 'v') {
6161
this.element.className += ' vertical';
6262
buttons = buttons.reverse();
6363
}
6464

65-
Lib.addRelatedStyleRule(modeBarId, '#' + modeBarId, 'background-color: ' + fullLayout.modeBarStyle.bgcolor);
66-
Lib.addRelatedStyleRule(modeBarId, '#' + modeBarId + ' .modebar-btn .icon path', 'fill: ' + fullLayout.modeBarStyle.iconColor);
67-
Lib.addRelatedStyleRule(modeBarId, '#' + modeBarId + ' .modebar-btn:hover .icon path', 'fill: ' + fullLayout.modeBarStyle.activeIconColor);
68-
Lib.addRelatedStyleRule(modeBarId, '#' + modeBarId + ' .modebar-btn.active .icon path', 'fill: ' + fullLayout.modeBarStyle.activeIconColor);
65+
Lib.addRelatedStyleRule(modeBarId, '#' + modeBarId, 'background-color: ' + fullLayout.modebar.bgcolor);
66+
Lib.addRelatedStyleRule(modeBarId, '#' + modeBarId + ' .modebar-btn .icon path', 'fill: ' + fullLayout.modebar.color);
67+
Lib.addRelatedStyleRule(modeBarId, '#' + modeBarId + ' .modebar-btn:hover .icon path', 'fill: ' + fullLayout.modebar.activecolor);
68+
Lib.addRelatedStyleRule(modeBarId, '#' + modeBarId + ' .modebar-btn.active .icon path', 'fill: ' + fullLayout.modebar.activecolor);
6969

7070
// if buttons or logo have changed, redraw modebar interior
7171
var needsNewButtons = !this.hasButtons(buttons);
@@ -80,7 +80,7 @@ proto.update = function(graphInfo, buttons) {
8080
this.updateButtons(buttons);
8181

8282
if(context.displaylogo) {
83-
if(fullLayout.modeBarStyle.orientation === 'v') {
83+
if(fullLayout.modebar.orientation === 'v') {
8484
this.element.prepend(this.getLogo());
8585
} else {
8686
this.element.appendChild(this.getLogo());

src/plots/layout_attributes.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ module.exports = {
225225
'make an item with matching `templateitemname` and `visible: false`.'
226226
].join(' ')
227227
},
228-
modeBarStyle: {
228+
modebar: {
229229
orientation: {
230230
valType: 'enumerated',
231231
values: ['v', 'h'],
@@ -241,14 +241,14 @@ module.exports = {
241241
editType: 'modebar',
242242
description: 'Sets the background color of the modebar.'
243243
},
244-
iconColor: {
244+
color: {
245245
valType: 'color',
246246
role: 'style',
247247
dflt: 'rgba(0, 31, 95, 0.3)',
248248
editType: 'modebar',
249249
description: 'Sets the color of the icons in the modebar.'
250250
},
251-
activeIconColor: {
251+
activecolor: {
252252
valType: 'color',
253253
role: 'style',
254254
dflt: 'rgba(0, 22, 72, 0.5)',

src/plots/plots.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -1334,10 +1334,10 @@ plots.supplyLayoutGlobalDefaults = function(layoutIn, layoutOut, formatObj) {
13341334

13351335
coerce('datarevision');
13361336

1337-
coerce('modeBarStyle.orientation');
1338-
coerce('modeBarStyle.bgcolor');
1339-
coerce('modeBarStyle.iconColor');
1340-
coerce('modeBarStyle.activeIconColor');
1337+
coerce('modebar.orientation');
1338+
coerce('modebar.bgcolor');
1339+
coerce('modebar.color');
1340+
coerce('modebar.activecolor');
13411341

13421342
Registry.getComponentMethod(
13431343
'calendars',

test/jasmine/tests/modebar_test.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,11 @@ describe('ModeBar', function() {
3333
_paperdiv: d3.select(getMockContainerTree()),
3434
_has: Plots._hasPlotType,
3535
_subplots: {xaxis: xaxes || [], yaxis: yaxes || []},
36-
modeBarStyle: {
36+
modebar: {
3737
orientation: 'h',
3838
bgcolor: 'rgba(255,255,255,0.7)',
39-
iconColor: 'rgba(0, 31, 95, 0.3)'
39+
color: 'rgba(0, 31, 95, 0.3)',
40+
activecolor: 'rgba(0, 31, 95, 1)'
4041
}
4142
},
4243
_fullData: [],

0 commit comments

Comments
 (0)