|
@@ -54,7 +54,7 @@ var sortCore = function (sKey, eKey, st) {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
-var triggerCustomEvent = function(list, type, ins) {
|
|
|
+var triggerCustomEvent = function(list, type, ins,curIndex) {
|
|
|
var _list = [], listData = [];
|
|
|
|
|
|
list.forEach(function (item) {
|
|
@@ -67,7 +67,7 @@ var triggerCustomEvent = function(list, type, ins) {
|
|
|
}
|
|
|
});
|
|
|
|
|
|
- ins.triggerEvent(type, {listData: listData});
|
|
|
+ ins.triggerEvent(type, {listData: listData,curIndex:curIndex});
|
|
|
}
|
|
|
|
|
|
var longPress = function (event, ownerInstance) {
|
|
@@ -169,7 +169,7 @@ var touchMove = function (event, ownerInstance) {
|
|
|
|
|
|
ownerInstance.callMethod("vibrate");
|
|
|
ownerInstance.callMethod("listChange", {list: list});
|
|
|
- triggerCustomEvent(list, "change", ownerInstance);
|
|
|
+ triggerCustomEvent(list, "change", ownerInstance,st.cur);
|
|
|
}
|
|
|
|
|
|
var touchEnd = function (event, ownerInstance) {
|
|
@@ -177,7 +177,7 @@ var touchEnd = function (event, ownerInstance) {
|
|
|
var st = ownerInstance.getState();
|
|
|
|
|
|
if (!st.dragging) return;
|
|
|
- triggerCustomEvent(st.list, "sortend", ownerInstance);
|
|
|
+ triggerCustomEvent(st.list, "sortend", ownerInstance,st.cur);
|
|
|
|
|
|
ins.addClass("tran");
|
|
|
ins.setStyle({
|