Skip to content

Commit 5c74610

Browse files
committed
merge doSceneDragmode and domodebar relayout checks,
so that 'dragmode' update also go through the modebar manager
1 parent 166da3b commit 5c74610

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/plot_api/plot_api.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2172,7 +2172,6 @@ Plotly.relayout = function relayout(gd, astr, val) {
21722172
doplot = false,
21732173
docalc = false,
21742174
domodebar = false,
2175-
doSceneDragmode = false,
21762175
newkey, axes, keys, xyref, scene, axisAttr;
21772176

21782177
if(typeof astr === 'string') aobj[astr] = val;
@@ -2406,8 +2405,7 @@ Plotly.relayout = function relayout(gd, astr, val) {
24062405
* height, width, autosize get dealt with below. Except for the case of
24072406
* of subplots - scenes - which require scene.handleDragmode to be called.
24082407
*/
2409-
else if(ai==='hovermode') domodebar = true;
2410-
else if (ai === 'dragmode') doSceneDragmode = true;
2408+
else if(['hovermode', 'dragmode'].indexOf(ai) !== -1) domodebar = true;
24112409
else if(['hovermode','dragmode','height',
24122410
'width','autosize'].indexOf(ai)===-1) {
24132411
doplot = true;
@@ -2466,10 +2464,10 @@ Plotly.relayout = function relayout(gd, astr, val) {
24662464
}
24672465

24682466
// this is decoupled enough it doesn't need async regardless
2469-
if(domodebar) manageModebar(gd);
2467+
if(domodebar) {
2468+
manageModebar(gd);
24702469

2471-
var subplotIds;
2472-
if(doSceneDragmode || domodebar) {
2470+
var subplotIds;
24732471
subplotIds = plots.getSubplotIds(fullLayout, 'gl3d');
24742472
for(i = 0; i < subplotIds.length; i++) {
24752473
scene = fullLayout[subplotIds[i]]._scene;

0 commit comments

Comments
 (0)