Skip to content

Commit 20616dd

Browse files
committed
revert changes to modebar.js for dynamic background
1 parent da5cc5f commit 20616dd

File tree

1 file changed

+2
-19
lines changed

1 file changed

+2
-19
lines changed

src/components/modebar/modebar.js

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ var d3 = require('@plotly/d3');
44
var isNumeric = require('fast-isnumeric');
55

66
var Lib = require('../../lib');
7-
var Color = require('../color');
87
var Icons = require('../../fonts/ploticon');
98
var version = require('../../version').version;
109

@@ -63,12 +62,6 @@ proto.update = function(graphInfo, buttons) {
6362
Lib.addRelatedStyleRule(modeBarId, '#' + modeBarId + ' .modebar-btn:hover .icon path', 'fill: ' + style.activecolor);
6463
Lib.addRelatedStyleRule(modeBarId, '#' + modeBarId + ' .modebar-btn.active .icon path', 'fill: ' + style.activecolor);
6564

66-
// logo constrast color
67-
var logoId = modeBarId + '-logo';
68-
var logoSelector = context.displayModeBar === 'hover' ? '.plotlyjsicon' : '';
69-
Lib.deleteRelatedStyleRule(logoId);
70-
Lib.addRelatedStyleRule(logoId, logoSelector + ' .cls-bg-contrast', 'fill: ' + Color.contrast(fullLayout.paper_bgcolor));
71-
7265
// if buttons or logo have changed, redraw modebar interior
7366
var needsNewButtons = !this.hasButtons(buttons);
7467
var needsNewLogo = (this.hasLogo !== context.displaylogo);
@@ -82,7 +75,7 @@ proto.update = function(graphInfo, buttons) {
8275
this.updateButtons(buttons);
8376

8477
if(context.watermark || context.displaylogo) {
85-
var logoGroup = this.getLogo(graphInfo);
78+
var logoGroup = this.getLogo();
8679
if(context.watermark) {
8780
logoGroup.className = logoGroup.className + ' watermark';
8881
}
@@ -299,7 +292,7 @@ function jsVersion(str) {
299292
/**
300293
* @return {HTMLDivElement} The logo image wrapped in a group
301294
*/
302-
proto.getLogo = function(graphInfo) {
295+
proto.getLogo = function() {
303296
var group = this.createGroup();
304297
var a = document.createElement('a');
305298

@@ -310,15 +303,6 @@ proto.getLogo = function(graphInfo) {
310303

311304
a.appendChild(this.createIcon(Icons.newplotlylogo));
312305

313-
var context = graphInfo._context;
314-
var fullLayout = graphInfo._fullLayout;
315-
var modeBarId = 'modebar-' + fullLayout._uid;
316-
317-
var logoId = modeBarId + '-logo';
318-
var logoSelector = context.displayModeBar === 'hover' ? '.plotlyjsicon' : '';
319-
Lib.deleteRelatedStyleRule(logoId);
320-
Lib.addRelatedStyleRule(logoId, logoSelector + ' .cls-bg-contrast', 'fill: ' + Color.contrast(fullLayout.paper_bgcolor));
321-
322306
group.appendChild(a);
323307
return group;
324308
};
@@ -334,7 +318,6 @@ proto.removeAllButtons = function() {
334318
proto.destroy = function() {
335319
Lib.removeElement(this.container.querySelector('.modebar'));
336320
Lib.deleteRelatedStyleRule(this._uid);
337-
Lib.deleteRelatedStyleRule(this._uid + '-logo');
338321
};
339322

340323
function createModeBar(gd, buttons) {

0 commit comments

Comments
 (0)