Skip to content

Commit c386d87

Browse files
committed
fix hybrid scenarios (touch + mouse)
see johnny#21
1 parent cd541dc commit c386d87

File tree

1 file changed

+5
-14
lines changed

1 file changed

+5
-14
lines changed

source/js/jquery-sortable.js

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -119,20 +119,11 @@
119119
tolerance: 0
120120
}, // end group defaults
121121
containerGroups = {},
122-
groupCounter = 0
123-
124-
if('ontouchstart' in window){
125-
eventNames = {
126-
start: "touchstart.sortable",
127-
end: "touchend.sortable touchcancel.sortable",
128-
move: "touchmove.sortable"
129-
}
130-
} else {
131-
eventNames = {
132-
start: "mousedown.sortable",
133-
end: "mouseup.sortable",
134-
move: "mousemove.sortable"
135-
}
122+
groupCounter = 0,
123+
eventNames = {
124+
start: "touchstart.sortable mousedown.sortable",
125+
end: "touchend.sortable touchcancel.sortable mouseup.sortable",
126+
move: "touchmove.sortable mousemove.sortable"
136127
}
137128

138129
/*

0 commit comments

Comments
 (0)