Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit fdb0c3c

Browse files
committedJul 8, 2016
update 'dragmode' cursor in relayout NOT modebar
1 parent 0d3fe54 commit fdb0c3c

File tree

2 files changed

+4
-20
lines changed

2 files changed

+4
-20
lines changed
 

‎src/components/modebar/buttons.js

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
var Plotly = require('../../plotly');
1313
var Lib = require('../../lib');
14-
var setCursor = require('../../lib/setcursor');
1514
var downloadImage = require('../../snapshot/download');
1615
var Icons = require('../../../build/ploticon');
1716

@@ -171,13 +170,6 @@ modeBarButtons.hoverCompareCartesian = {
171170
click: handleCartesian
172171
};
173172

174-
var DRAGCURSORS = {
175-
pan: 'move',
176-
zoom: 'crosshair',
177-
select: 'crosshair',
178-
lasso: 'crosshair'
179-
};
180-
181173
function handleCartesian(gd, ev) {
182174
var button = ev.currentTarget,
183175
astr = button.getAttribute('data-attr'),
@@ -227,18 +219,7 @@ function handleCartesian(gd, ev) {
227219
aobj[astr] = val;
228220
}
229221

230-
Plotly.relayout(gd, aobj).then(function() {
231-
if(astr === 'dragmode') {
232-
if(fullLayout._has('cartesian')) {
233-
setCursor(
234-
fullLayout._paper.select('.nsewdrag'),
235-
DRAGCURSORS[val]
236-
);
237-
}
238-
Plotly.Fx.supplyLayoutDefaults(gd.layout, fullLayout, gd._fullData);
239-
Plotly.Fx.init(gd);
240-
}
241-
});
222+
Plotly.relayout(gd, aobj);
242223
}
243224

244225
modeBarButtons.zoom3d = {

‎src/plot_api/plot_api.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2429,6 +2429,9 @@ Plotly.relayout = function relayout(gd, astr, val) {
24292429
var subplotIds;
24302430
manageModeBar(gd);
24312431

2432+
Plotly.Fx.supplyLayoutDefaults(gd.layout, fullLayout, gd._fullData);
2433+
Plotly.Fx.init(gd);
2434+
24322435
subplotIds = Plots.getSubplotIds(fullLayout, 'gl3d');
24332436
for(i = 0; i < subplotIds.length; i++) {
24342437
scene = fullLayout[subplotIds[i]]._scene;

0 commit comments

Comments
 (0)
Please sign in to comment.