MCPcopy
hub / github.com/bevacqua/dragula / startBecauseMouseMoved

Function startBecauseMouseMoved

dragula.js:118–155  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

116 }
117
118 function startBecauseMouseMoved (e) {
119 if (!_grabbed) {
120 return;
121 }
122 if (whichMouseButton(e) === 0) {
123 release({});
124 return; // when text is selected on an input and then dragged, mouseup doesn't fire. this is our only hope
125 }
126
127 // truthy check fixes #239, equality fixes #207, fixes #501
128 if ((e.clientX !== void 0 && Math.abs(e.clientX - _moveX) <= (o.slideFactorX || 0)) &&
129 (e.clientY !== void 0 && Math.abs(e.clientY - _moveY) <= (o.slideFactorY || 0))) {
130 return;
131 }
132
133 if (o.ignoreInputTextSelection) {
134 var clientX = getCoord('clientX', e) || 0;
135 var clientY = getCoord('clientY', e) || 0;
136 var elementBehindCursor = doc.elementFromPoint(clientX, clientY);
137 if (isInput(elementBehindCursor)) {
138 return;
139 }
140 }
141
142 var grabbed = _grabbed; // call to end() unsets _grabbed
143 eventualMovements(true);
144 movements();
145 end();
146 start(grabbed);
147
148 var offset = getOffset(_item);
149 _offsetX = getCoord('pageX', e) - offset.left;
150 _offsetY = getCoord('pageY', e) - offset.top;
151
152 classes.add(_copy || _item, 'gu-transit');
153 renderMirrorImage();
154 drag(e);
155 }
156
157 function canStart (item) {
158 if (drake.dragging && _mirror) {

Callers

nothing calls this directly

Calls 11

whichMouseButtonFunction · 0.85
releaseFunction · 0.85
getCoordFunction · 0.85
isInputFunction · 0.85
eventualMovementsFunction · 0.85
movementsFunction · 0.85
startFunction · 0.85
getOffsetFunction · 0.85
renderMirrorImageFunction · 0.85
endFunction · 0.70
dragFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…