@@ -52,7 +52,8 @@ module.exports = function dragBox(gd, plotinfo, x, y, w, h, ns, ew) {
52
52
pw = xa [ 0 ] . _length ,
53
53
ph = ya [ 0 ] . _length ,
54
54
MINDRAG = constants . MINDRAG ,
55
- MINZOOM = constants . MINZOOM ;
55
+ MINZOOM = constants . MINZOOM ,
56
+ isMainDrag = ( ns + ew === 'nsew' ) ;
56
57
57
58
for ( var i = 1 ; i < subplots . length ; i ++ ) {
58
59
var subplotXa = subplots [ i ] . x ( ) ,
@@ -89,7 +90,7 @@ module.exports = function dragBox(gd, plotinfo, x, y, w, h, ns, ew) {
89
90
// and stop there
90
91
if ( ! yActive && ! xActive ) {
91
92
dragger . onmousedown = null ;
92
- dragger . style . pointerEvents = ( ns + ew === 'nsew' ) ? 'all' : 'none' ;
93
+ dragger . style . pointerEvents = isMainDrag ? 'all' : 'none' ;
93
94
return dragger ;
94
95
}
95
96
@@ -107,7 +108,8 @@ module.exports = function dragBox(gd, plotinfo, x, y, w, h, ns, ew) {
107
108
doubleclick : doubleClick ,
108
109
prepFn : function ( e , startX , startY ) {
109
110
var dragModeNow = gd . _fullLayout . dragmode ;
110
- if ( ns + ew === 'nsew' ) {
111
+
112
+ if ( isMainDrag ) {
111
113
// main dragger handles all drag modes, and changes
112
114
// to pan (or to zoom if it already is pan) on shift
113
115
if ( e . shiftKey ) {
0 commit comments