Skip to content

Commit 30876b2

Browse files
committed
stash dragging on object instead of parcoords trace module
1 parent fe7e02c commit 30876b2

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

src/traces/parcoords/axisbrush.js

+7-9
Original file line numberDiff line numberDiff line change
@@ -233,15 +233,12 @@ function dragstart(lThis, d) {
233233
s.brushStartCallback();
234234
}
235235

236-
var dragging = false;
237-
238236
function drag(lThis, d) {
239-
dragging = true;
240-
241237
d3.event.sourceEvent.stopPropagation();
242238
var y = d.height - d3.mouse(lThis)[1] - 2 * c.verticalPadding;
243239
var s = d.brush.svgBrush;
244240
s.wasDragged = true;
241+
s._dragging = true;
245242

246243
if(s.grabbingBar) { // moving the bar
247244
s.newExtent = [y - s.grabPoint, y + s.barLength - s.grabPoint].map(d.unitToPaddedPx.invert);
@@ -256,20 +253,21 @@ function drag(lThis, d) {
256253
}
257254

258255
function dragend(lThis, d) {
259-
if(!dragging) { // i.e. click
256+
var brush = d.brush;
257+
var filter = brush.filter;
258+
var s = brush.svgBrush;
259+
260+
if(!s._dragging) { // i.e. click
260261
// mock zero drag
261262
mousemove(lThis, d);
262263
drag(lThis, d);
263264
// remember it is a click not a drag
264265
d.brush.svgBrush.wasDragged = false;
265266
}
266-
dragging = false;
267+
s._dragging = false;
267268

268269
var e = d3.event;
269270
e.sourceEvent.stopPropagation();
270-
var brush = d.brush;
271-
var filter = brush.filter;
272-
var s = brush.svgBrush;
273271
var grabbingBar = s.grabbingBar;
274272
s.grabbingBar = false;
275273
s.grabLocation = undefined;

0 commit comments

Comments
 (0)