react-reorder
Advanced tools
Comparing version 3.0.0-alpha.6 to 3.0.0-alpha.7
@@ -18,3 +18,4 @@ import Immutable from 'immutable'; | ||
})), | ||
prefix: 'Prefix' | ||
prefix: 'Prefix', | ||
clickedItem: null | ||
}; | ||
@@ -39,2 +40,8 @@ } | ||
onClickItem (name) { | ||
this.setState({ | ||
clickedItem: name | ||
}); | ||
} | ||
render () { | ||
@@ -55,3 +62,8 @@ return ( | ||
{'Prefix: '} | ||
<input type="text" value={this.state.prefix} onChange={this.onPrefixChange.bind(this)} /> | ||
<input | ||
type="text" | ||
value={this.state.prefix} | ||
onChange={this.onPrefixChange.bind(this)} | ||
/>{' '} | ||
Last item clicked: {this.state.clickedItem} | ||
</p> | ||
@@ -76,2 +88,3 @@ | ||
style={{ color: color }} | ||
onClick={this.onClickItem.bind(this, name)} | ||
> | ||
@@ -78,0 +91,0 @@ <div className={classNames.contentHolder}> |
@@ -18,3 +18,4 @@ import Immutable from 'immutable'; | ||
})), | ||
prefix: 'Prefix' | ||
prefix: 'Prefix', | ||
clickedItem: null | ||
}; | ||
@@ -45,2 +46,8 @@ } | ||
onClickItem (name) { | ||
this.setState({ | ||
clickedItem: name | ||
}); | ||
} | ||
render () { | ||
@@ -61,4 +68,4 @@ return ( | ||
onChange={this.onDisableToggle.bind(this)} | ||
/> | ||
Last item clicked: {this.state.clickedItem2 ? this.state.clickedItem2.name : undefined} | ||
/>{' '} | ||
Last item clicked: {this.state.clickedItem} | ||
</p> | ||
@@ -83,2 +90,3 @@ | ||
style={{color: color}} | ||
onClick={this.onClickItem.bind(this, name)} | ||
> | ||
@@ -85,0 +93,0 @@ {name} |
{ | ||
"name": "react-reorder", | ||
"version": "3.0.0-alpha.6", | ||
"version": "3.0.0-alpha.7", | ||
"description": "Drag & drop, touch enabled, reorderable / sortable list, React component", | ||
@@ -5,0 +5,0 @@ "author": "Jake 'Sid' Smith", |
@@ -105,3 +105,3 @@ # React Reorder | ||
this.setState({ | ||
myList: reorder(this.state.myList, fromIndex, toIndex); | ||
myList: reorder(this.state.myList, previousIndex, nextIndex); | ||
}); | ||
@@ -108,0 +108,0 @@ } |
@@ -683,4 +683,4 @@ 'use strict'; | ||
// Add listeners | ||
componentWillMount: function () { | ||
// Add listeners and store root node | ||
componentDidMount: function () { | ||
store.registerReorderComponent(this); | ||
@@ -692,6 +692,2 @@ window.addEventListener('mouseup', this.onWindowUp, {passive: false}); | ||
window.addEventListener('contextmenu', this.preventContextMenu, {passive: false}); | ||
}, | ||
// Store root node | ||
componentDidMount: function () { | ||
this.storeRootNode(); | ||
@@ -698,0 +694,0 @@ }, |
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
89031
2240