Skip to content

Fix mobile support #277

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions source/js/jquery-sortable.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* ===================================================
* jquery-sortable.js v0.9.13
* jquery-sortable.js v0.9.14
* http://johnny.github.com/jquery-sortable/
* ===================================================
* Copyright (c) 2012 Jonas von Andrian
Expand Down Expand Up @@ -85,6 +85,7 @@
// The Placeholder has not been moved yet.
onDrag: function ($item, position, _super, event) {
$item.css(position)
event.preventDefault()
},
// Called after the drag has been started,
// that is the mouse button is being held down and
Expand All @@ -108,7 +109,7 @@
// Ignore if element clicked is input, select or textarea
onMousedown: function ($item, _super, event) {
if (!event.target.nodeName.match(/^(input|select|textarea)$/i)) {
event.preventDefault()
if (event.type.match(/^mouse/)) event.preventDefault()
return true
}
},
Expand All @@ -126,9 +127,9 @@
serialize: function ($parent, $children, parentIsContainer) {
var result = $.extend({}, $parent.data())

if(parentIsContainer)
if (parentIsContainer) {
return [$children]
else if ($children[0]){
} else if ($children[0]){
result.children = $children
}

Expand Down Expand Up @@ -253,7 +254,7 @@
this.item = closestItem;
this.itemContainer = itemContainer;
if (this.item.is(this.options.exclude) || !this.options.onMousedown(this.item, groupDefaults.onMousedown, e)) {
return;
return;
}
this.setPointer(e);
this.toggleListeners('on');
Expand Down Expand Up @@ -400,10 +401,11 @@
) >= this.options.distance)
},
getPointer: function(e) {
var o = e.originalEvent || e.originalEvent.touches && e.originalEvent.touches[0]
var o = e.originalEvent,
t = (e.originalEvent.touches && e.originalEvent.touches[0]) || {}
return {
left: e.pageX || o.pageX,
top: e.pageY || o.pageY
left: e.pageX || o.pageX || t.pageX,
top: e.pageY || o.pageY || t.pageY
}
},
setupDelayTimer: function () {
Expand Down