Comparing version 2.1.4 to 2.1.5
@@ -74,3 +74,3 @@ "use strict"; | ||
} | ||
state.moved(); | ||
state.onMove(); | ||
} | ||
@@ -86,3 +86,3 @@ e.preventDefault(); | ||
if (e) { | ||
state.dropped(); | ||
state.onDrop(); | ||
} | ||
@@ -108,3 +108,3 @@ document.removeEventListener('mousemove', this.onMouseMove); | ||
} | ||
state.moved(); | ||
state.onMove(); | ||
} | ||
@@ -120,3 +120,3 @@ e.preventDefault(); | ||
if (e) { | ||
state.dropped(); | ||
state.onDrop(); | ||
} | ||
@@ -155,3 +155,3 @@ document.removeEventListener('touchmove', this.onTouchMove); | ||
let state = new DragManager.DragState(e, this, true); | ||
if (Math.abs(state.dx) < 1 && Math.abs(state.dy) < 1) { | ||
if (!state.moved()) { | ||
// not a move | ||
@@ -170,3 +170,3 @@ return false; | ||
} | ||
state.moved(); | ||
state.onMove(); | ||
document.addEventListener('keydown', this.onKeyDown); | ||
@@ -173,0 +173,0 @@ return true; |
@@ -19,2 +19,3 @@ interface DragDropComponent { | ||
constructor(event: MouseEvent | TouchEvent, component: DragDropComponent, init?: boolean); | ||
moved(): boolean; | ||
/** | ||
@@ -33,4 +34,4 @@ * @param refElement, the element being moved | ||
reject(): void; | ||
moved(): void; | ||
dropped(): void; | ||
onMove(): void; | ||
onDrop(): void; | ||
} | ||
@@ -37,0 +38,0 @@ export declare type DragHandler = (state: DragState) => void; |
@@ -38,2 +38,5 @@ "use strict"; | ||
} | ||
moved() { | ||
return Math.abs(this.dx) >= 1 || Math.abs(this.dy) >= 1; | ||
} | ||
/** | ||
@@ -71,3 +74,3 @@ * @param refElement, the element being moved | ||
} | ||
moved() { | ||
onMove() { | ||
if (_data) { | ||
@@ -93,3 +96,3 @@ let searchElement = document.elementFromPoint(this.pageX, this.pageY); | ||
} | ||
dropped() { | ||
onDrop() { | ||
if (_droppingHandlers && _droppingHandlers.onDropT) { | ||
@@ -96,0 +99,0 @@ _droppingHandlers.onDropT(this); |
{ | ||
"name": "rc-dock", | ||
"version": "2.1.4", | ||
"version": "2.1.5", | ||
"description": "dock layout for react component", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -48,2 +48,6 @@ interface DragDropComponent { | ||
moved(): boolean { | ||
return Math.abs(this.dx) >= 1 || Math.abs(this.dy) >= 1; | ||
} | ||
/** | ||
@@ -90,3 +94,3 @@ * @param refElement, the element being moved | ||
moved() { | ||
onMove() { | ||
if (_data) { | ||
@@ -113,3 +117,3 @@ let searchElement = document.elementFromPoint(this.pageX, this.pageY) as HTMLElement; | ||
dropped() { | ||
onDrop() { | ||
if (_droppingHandlers && _droppingHandlers.onDropT) { | ||
@@ -116,0 +120,0 @@ _droppingHandlers.onDropT(this); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
565182
8367