Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 113e802

Browse files
committed
Remove delay for action after double click
1 parent 0c6ecb6 commit 113e802

File tree

2 files changed

+1
-18
lines changed

2 files changed

+1
-18
lines changed

src/plots/cartesian/constants.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ module.exports = {
2828

2929
// ms between first mousedown and 2nd mouseup to constitute dblclick...
3030
// we don't seem to have access to the system setting
31-
DBLCLICKDELAY: 600,
31+
DBLCLICKDELAY: 300,
3232

3333
// pixels to move mouse before you stop clamping to starting point
3434
MINDRAG: 8,

src/plots/cartesian/graph_interact.js

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1576,7 +1576,6 @@ function dragBox(gd, plotinfo, x, y, w, h, ns, ew) {
15761576
function zoomDone(dragged, numClicks) {
15771577
if(Math.min(box.h, box.w) < MINDRAG * 2) {
15781578
if(numClicks === 2) doubleClick();
1579-
else pauseForDrag(gd);
15801579

15811580
return removeZoombox(gd);
15821581
}
@@ -1629,7 +1628,6 @@ function dragBox(gd, plotinfo, x, y, w, h, ns, ew) {
16291628
}
16301629
});
16311630
}
1632-
else pauseForDrag(gd);
16331631
}
16341632

16351633
// scroll zoom, on all draggers except corners
@@ -1932,21 +1930,6 @@ function getEndText(ax, end) {
19321930
}
19331931
}
19341932

1935-
function pauseForDrag(gd) {
1936-
// prevent more redraws until we know if a doubleclick
1937-
// has occurred
1938-
gd._dragging = true;
1939-
var deferredReplot = gd._replotPending;
1940-
gd._replotPending = false;
1941-
1942-
setTimeout(function() {
1943-
gd._replotPending = deferredReplot;
1944-
finishDrag(gd);
1945-
},
1946-
constants.DBLCLICKDELAY
1947-
);
1948-
}
1949-
19501933
function finishDrag(gd) {
19511934
gd._dragging = false;
19521935
if(gd._replotPending) Plotly.plot(gd);

0 commit comments

Comments
 (0)