drag-drop-list-react
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -64,2 +64,3 @@ 'use strict'; | ||
currList: 42, | ||
isInList: false, | ||
upState: null | ||
@@ -304,4 +305,4 @@ }; | ||
var currY = Math.round(window.scrollY || window.pageYOffset); | ||
var pageH = document.body.scrollHeight - window.innerHeight; | ||
var pageW = document.body.scrollWidth - window.innerWidth; | ||
var pageH = Math.max(document.body.scrollHeight, document.documentElement.scrollHeight) - window.innerHeight; | ||
var pageW = Math.max(document.body.scrollWidth, document.documentElement.scrollWidth) - window.innerWidth; | ||
if (dragData.ePos.x - this.props.scrollWhen < 0) { | ||
@@ -361,8 +362,12 @@ window.scrollTo(Math.max(0, currX - scrollDetails.step), currY); | ||
value: function moveFlying(item, listScrollCallback, newListId) { | ||
if (dragData.currList !== newListId) { | ||
if (dragData.currList !== -15841584) { | ||
if (item === null || dragData.isInList === false || dragData.currList !== newListId) { | ||
if (dragData.isInList) { | ||
dragData.target.dispatchEvent(new Event('leaveMeh', { bubbles: true })); | ||
} | ||
dragData.currList = newListId; | ||
dragData.isInList = true; | ||
dragData.scrollListCallback = listScrollCallback; | ||
if (item === null) { | ||
dragData.isInList = false; | ||
} | ||
} | ||
@@ -372,3 +377,3 @@ if (dragData.target !== item) { | ||
if (dragData.target !== null) { | ||
console.log('enterMeh'); | ||
//console.log('enterMeh'); | ||
dragData.target.dispatchEvent(new Event('enterMeh', { bubbles: true })); | ||
@@ -381,3 +386,3 @@ } | ||
value: function moveFlyingBody() { | ||
this.moveFlying(null, null, -15841584); | ||
this.moveFlying(null, null, -1); | ||
} | ||
@@ -399,3 +404,3 @@ }, { | ||
if (dragData.item !== null) { | ||
console.log(e); | ||
//console.log(e); | ||
dragData.ePos = dragData.isTouchOrMouse ? { x: e.touches.item(0).clientX, y: e.touches.item(0).clientY } : { x: e.clientX, y: e.clientY }; | ||
@@ -493,2 +498,3 @@ e.preventDefault(); | ||
dragData.currList = this.props.myGid; | ||
dragData.isInList = true; | ||
dragData.target = this.me; | ||
@@ -652,3 +658,2 @@ dragData.dropCallback = this.dropCallback; | ||
myGid: _propTypes2.default.number.isRequired, | ||
clone: _propTypes2.default.number, | ||
dragName: _propTypes2.default.string, | ||
@@ -655,0 +660,0 @@ dropName: _propTypes2.default.string, |
@@ -100,3 +100,2 @@ 'use strict'; | ||
myGid: this.props.myGid, | ||
clone: this.props.clone, | ||
dragName: this.props.dragName, | ||
@@ -129,3 +128,2 @@ dropName: this.props.dropName, | ||
myGid: _propTypes2.default.number.isRequired, | ||
clone: _propTypes2.default.number, | ||
dragName: _propTypes2.default.string, | ||
@@ -132,0 +130,0 @@ dropName: _propTypes2.default.string, |
{ | ||
"name": "drag-drop-list-react", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "A library that implements drag-drop lists for react.", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
1035
103964
285