Skip to content

Commit 1776dc4

Browse files
committed
Update app.bundle.js
1 parent 2f5b87c commit 1776dc4

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

examples/app.bundle.js

+16-16
Original file line numberDiff line numberDiff line change
@@ -19800,7 +19800,7 @@
1980019800
};
1980119801

1980219802
var SortableMixin = function SortableMixin() {
19803-
var sortableOptions = arguments.length <= 0 || arguments[0] === undefined ? defaultOptions : arguments[0];
19803+
var options = arguments.length <= 0 || arguments[0] === undefined ? defaultOptions : arguments[0];
1980419804
return function (Component) {
1980519805
return function (_React$Component) {
1980619806
_inherits(_class2, _React$Component);
@@ -19816,36 +19816,37 @@
1981619816
args[_key2] = arguments[_key2];
1981719817
}
1981819818

19819-
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_Object$getPrototypeO = Object.getPrototypeOf(_class2)).call.apply(_Object$getPrototypeO, [this].concat(args))), _this), _this.sortableInstance = null, _this.sortableOptions = sortableOptions, _temp), _possibleConstructorReturn(_this, _ret);
19819+
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_Object$getPrototypeO = Object.getPrototypeOf(_class2)).call.apply(_Object$getPrototypeO, [this].concat(args))), _this), _this.sortableInstance = null, _this.sortableOptions = extend({}, defaultOptions, options), _temp), _possibleConstructorReturn(_this, _ret);
1982019820
}
1982119821

1982219822
_createClass(_class2, [{
1982319823
key: 'componentDidMount',
1982419824
value: function componentDidMount() {
19825-
var wrapperComponent = this;
19826-
var sortableComponent = wrapperComponent.refs[refName];
19827-
var options = extend({}, defaultOptions, wrapperComponent.sortableOptions);
19825+
var _this2 = this;
19826+
19827+
var sortableComponent = this.refs[refName];
1982819828
var emitEvent = function emitEvent(type, evt) {
19829-
var methodName = options[type];
19829+
var methodName = _this2.sortableOptions[type];
1983019830
var method = sortableComponent[methodName];
19831-
method && method.call(sortableComponent, evt, wrapperComponent.sortableInstance);
19831+
method && method.call(sortableComponent, evt, _this2.sortableInstance);
1983219832
};
1983319833

19834-
var copyOptions = extend({}, options);
19834+
var copyOptions = extend({}, this.sortableOptions);
19835+
1983519836
[// Bind callbacks
1983619837
'onStart', 'onEnd', 'onAdd', 'onSort', 'onUpdate', 'onRemove', 'onFilter', 'onMove'].forEach(function (name) {
1983719838
copyOptions[name] = function (evt) {
1983819839
if (name === 'onStart') {
1983919840
_nextSibling = evt.item.nextElementSibling;
19840-
_activeWrapperComponent = wrapperComponent;
19841+
_activeWrapperComponent = _this2;
1984119842
} else if (name === 'onAdd' || name === 'onUpdate') {
1984219843
evt.from.insertBefore(evt.item, _nextSibling);
1984319844

1984419845
var oldIndex = evt.oldIndex;
1984519846
var newIndex = evt.newIndex;
1984619847
var newState = {};
1984719848
var remoteState = {};
19848-
var items = getModelItems(wrapperComponent);
19849+
var items = getModelItems(_this2);
1984919850

1985019851
if (name === 'onAdd') {
1985119852
var remoteItems = getModelItems(_activeWrapperComponent);
@@ -19857,15 +19858,15 @@
1985719858
items.splice(newIndex, 0, items.splice(oldIndex, 1)[0]);
1985819859
}
1985919860

19860-
newState[wrapperComponent.sortableOptions.model] = items;
19861+
newState[_this2.sortableOptions.model] = items;
1986119862

1986219863
if (copyOptions.stateHandler) {
1986319864
sortableComponent[copyOptions.stateHandler](newState);
1986419865
} else {
1986519866
sortableComponent.setState(newState);
1986619867
}
1986719868

19868-
if (_activeWrapperComponent !== wrapperComponent) {
19869+
if (_activeWrapperComponent !== _this2) {
1986919870
_activeWrapperComponent.refs[refName].setState(remoteState);
1987019871
}
1987119872
}
@@ -19876,15 +19877,14 @@
1987619877
};
1987719878
});
1987819879

19879-
var domNode = _reactDom2.default.findDOMNode(sortableComponent.refs[options.ref] || sortableComponent);
19880+
var domNode = _reactDom2.default.findDOMNode(sortableComponent.refs[this.sortableOptions.ref] || sortableComponent);
1988019881
this.sortableInstance = _sortablejs2.default.create(domNode, copyOptions);
1988119882
}
1988219883
}, {
1988319884
key: 'componentWillReceiveProps',
1988419885
value: function componentWillReceiveProps(nextProps) {
19885-
var wrapperComponent = this;
19886-
var sortableComponent = wrapperComponent.refs[refName];
19887-
var model = wrapperComponent.sortableOptions.model;
19886+
var sortableComponent = this.refs[refName];
19887+
var model = this.sortableOptions.model;
1988819888
var items = nextProps[model];
1988919889

1989019890
if (items) {

0 commit comments

Comments
 (0)