MCPcopy Index your code
hub / github.com/gridstack/gridstack.js / _dragFollow

Method _dragFollow

src/dd-draggable.ts:376–389  ·  view source on GitHub ↗

@internal updates the top/left position to follow the mouse

(e: DragEvent)

Source from the content-addressed store, hash-verified

374
375 /** @internal updates the top/left position to follow the mouse */
376 public _dragFollow(e: DragEvent): void {
377 const style = this.helper.style;
378 const offset = this.dragOffset;
379 if (this.option.rtl) {
380 style.right = ((window.innerWidth - e.clientX) + offset.offsetX) * this.dragTransform.xScale + 'px';
381 if (style.left)
382 style.left = '';
383 } else {
384 style.left = (e.clientX + offset.offsetX) * this.dragTransform.xScale + 'px';
385 if (style.right)
386 style.right = '';
387 }
388 style.top = (e.clientY + offset.offsetTop) * this.dragTransform.yScale + 'px';
389 }
390
391 /** @internal */
392 protected _setupHelperContainmentStyle(): DDDraggable {

Callers 3

_mouseMoveMethod · 0.95
_setupHelperStyleMethod · 0.95
DDDraggableClass · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected