Skip to content

Commit 3c67fb7

Browse files
committed
Merge pull request #20 from dimchez/master
Bug fix for cases when touch does not work because touches is not defined on jQuery event
2 parents 2b32f9b + 6c381e7 commit 3c67fb7

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/angular-sortable-view.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -544,9 +544,12 @@
544544
].join(''));
545545

546546
function touchFix(e){
547-
if(!('clientX' in e) && !('clientY' in e)){
548-
e.clientX = e.touches[0].clientX;
549-
e.clientY = e.touches[0].clientY;
547+
if(!('clientX' in e) && !('clientY' in e)) {
548+
var touches = e.touches || e.originalEvent.touches;
549+
if(touches && touches.length) {
550+
e.clientX = touches[0].clientX;
551+
e.clientY = touches[0].clientY;
552+
}
550553
e.preventDefault();
551554
}
552555
}

0 commit comments

Comments
 (0)