File tree 1 file changed +3
-6
lines changed
src/components/dragelement
1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -78,10 +78,6 @@ dragElement.init = function init(options) {
78
78
element . ontouchstart = onStart ;
79
79
80
80
function onStart ( e ) {
81
- if ( e . buttons && e . buttons === 2 ) { // right click
82
- return ;
83
- }
84
-
85
81
// make dragging and dragged into properties of gd
86
82
// so that others can look at and modify them
87
83
gd . _dragged = false ;
@@ -90,6 +86,7 @@ dragElement.init = function init(options) {
90
86
startX = offset [ 0 ] ;
91
87
startY = offset [ 1 ] ;
92
88
initialTarget = e . target ;
89
+ var rightClick = e . buttons && e . buttons === 2 ;
93
90
94
91
newMouseDownTime = ( new Date ( ) ) . getTime ( ) ;
95
92
if ( newMouseDownTime - gd . _mouseDownTime < DBLCLICKDELAY ) {
@@ -104,11 +101,11 @@ dragElement.init = function init(options) {
104
101
105
102
if ( options . prepFn ) options . prepFn ( e , startX , startY ) ;
106
103
107
- if ( hasHover && ( ! e . buttons || ( e . buttons && e . buttons !== 2 ) ) ) {
104
+ if ( hasHover && ! rightClick ) {
108
105
dragCover = coverSlip ( ) ;
109
106
dragCover . style . cursor = window . getComputedStyle ( element ) . cursor ;
110
107
}
111
- else {
108
+ else if ( ! hasHover ) {
112
109
// document acts as a dragcover for mobile, bc we can't create dragcover dynamically
113
110
dragCover = document ;
114
111
cursor = window . getComputedStyle ( document . documentElement ) . cursor ;
You can’t perform that action at this time.
0 commit comments