Skip to content

Commit d76d64d

Browse files
committed
call updateFx on doModeBar restyle calls
1 parent 0b7a924 commit d76d64d

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

src/plot_api/subroutines.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -378,17 +378,23 @@ exports.doTicksRelayout = function(gd) {
378378

379379
exports.doModeBar = function(gd) {
380380
var fullLayout = gd._fullLayout;
381-
var subplotIds, i;
381+
var subplotIds, scene, i;
382382

383383
ModeBar.manage(gd);
384384
initInteractions(gd);
385385

386386
subplotIds = Plots.getSubplotIds(fullLayout, 'gl3d');
387387
for(i = 0; i < subplotIds.length; i++) {
388-
var scene = fullLayout[subplotIds[i]]._scene;
388+
scene = fullLayout[subplotIds[i]]._scene;
389389
scene.updateFx(fullLayout.dragmode, fullLayout.hovermode);
390390
}
391391

392+
subplotIds = Plots.getSubplotIds(fullLayout, 'gl2d');
393+
for(i = 0; i < subplotIds.length; i++) {
394+
scene = fullLayout._plots[subplotIds[i]]._scene2d;
395+
scene.updateFx(fullLayout.dragmode);
396+
}
397+
392398
return Plots.previousPromises(gd);
393399
};
394400

src/plots/gl2d/scene2d.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ proto.plot = function(fullData, calcData, fullLayout) {
372372

373373
this.updateRefs(fullLayout);
374374
this.updateTraces(fullData, calcData);
375-
this.updateFx();
375+
this.updateFx(fullLayout.dragmode);
376376

377377
var width = fullLayout.width,
378378
height = fullLayout.height;
@@ -511,9 +511,7 @@ proto.updateTraces = function(fullData, calcData) {
511511
});
512512
};
513513

514-
proto.updateFx = function() {
515-
var dragmode = this.fullLayout.dragmode;
516-
514+
proto.updateFx = function(dragmode) {
517515
if(dragmode === 'lasso' || dragmode === 'select') {
518516
this.mouseContainer.style['pointer-events'] = 'none';
519517
} else {

0 commit comments

Comments
 (0)