Подтвердить что ты не робот

Jquery-ui сортировать | Как заставить его работать на iPad/touchdevices?

Как мне получить сортировку jquery-ui на iPad и других сенсорных платформах? http://jqueryui.com/demos/sortable/

Я пытался работать с

event.preventDefault();
event.cancelBubble=true;
event.stopPropagation();

для touchmove и события прокрутки, но единственный результат - как и ожидалось - что страница больше не прокручивается.

Любые идеи? СПАСИБО! EH!

4b9b3361

Ответ 2

Том, Я добавил следующий код в mouseProto._touchStart событие:

var time1Sec;
var ifProceed = false, timerStart = false;
mouseProto._touchStart = function (event) {

    var self = this;

    // Ignore the event if another widget is already being handled
    if (touchHandled || !self._mouseCapture(event.originalEvent.changedTouches[0])) {
        return;
    }

    if (!timerStart) {
        time1Sec = setTimeout(function () {
            ifProceed = true;
        }, 1000);
        timerStart=true;
    }
    if (ifProceed) {
        // Set the flag to prevent other widgets from inheriting the touch event
        touchHandled = true;

        // Track movement to determine if interaction was a click
        self._touchMoved = false;

        // Simulate the mouseover event
        simulateMouseEvent(event, 'mouseover');

        // Simulate the mousemove event
        simulateMouseEvent(event, 'mousemove');

        // Simulate the mousedown event
        simulateMouseEvent(event, 'mousedown');
        ifProceed = false;
         timerStart=false;
        clearTimeout(time1Sec);
    }
};