react-upload-gallery
Advanced tools
Comparing version 0.1.3 to 0.2.0
@@ -41,3 +41,6 @@ "use strict"; | ||
newIndex = _ref4.newIndex; | ||
setSort((0, _Utils.arrayMove)(images, oldIndex, newIndex)); | ||
setSort((0, _Utils.arrayMove)(images, oldIndex, newIndex), { | ||
oldIndex: oldIndex, | ||
newIndex: newIndex | ||
}); | ||
} | ||
@@ -44,0 +47,0 @@ }), /*#__PURE__*/_react["default"].createElement("div", { |
@@ -37,2 +37,3 @@ "use strict"; | ||
onChange: func, | ||
onSortEnd: func, | ||
onError: func, | ||
@@ -77,2 +78,3 @@ onClick: func, | ||
onChange: _propTypes["default"].func, | ||
onSortEnd: _propTypes["default"].func, | ||
onError: _propTypes["default"].func, | ||
@@ -79,0 +81,0 @@ onClick: _propTypes["default"].func, |
@@ -637,3 +637,3 @@ "use strict"; | ||
key: "setSort", | ||
value: function setSort(images) { | ||
value: function setSort(images, diff) { | ||
var _this12 = this; | ||
@@ -644,3 +644,5 @@ | ||
}, function () { | ||
return _this12.props.onChange(images); | ||
_this12.props.onChange(images); | ||
_this12.props.onSortEnd(images, diff); | ||
}); | ||
@@ -647,0 +649,0 @@ } |
{ | ||
"name": "react-upload-gallery", | ||
"version": "0.1.3", | ||
"version": "0.2.0", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "author": "Muhammet INAN", |
@@ -89,2 +89,3 @@ # React Upload Gallery | ||
| `onChange` | `Function` | `empty` | Works when application starts and any state changes. | | ||
| `onSortEnd` | `Function` | `empty` | It works when the position of pictures changes. `function(images, { oldIndex, newIndex })` | | ||
| `onError` | `Function` | `empty` | Returns `status`,` response` if http request fails. `function({ status, response, image })` | | ||
@@ -91,0 +92,0 @@ | `onClick` | `Function` | `empty` | Keeps clicks on the display card. [onClick](#onClick) | |
Sorry, the diff of this file is not supported yet
93031
1850
342