https://bugzilla.wikimedia.org/show_bug.cgi?id=72566

--- Comment #13 from Chris H-C <[email protected]> ---
Since BlackBerry 6, BlackBerry devices ran a version of WebKit.
addEventListener's just fine.

The problem is the touch detector. I don't have the source, but Chrome
prettifies it fairly well for me. It looks something like:

    (function($) {
        var $window = $(window), moved, tapEv;
        function handleTap(ev) {
            tapEv = $.Event('tap');
            if (!moved)
                $(ev.target).trigger(tapEv);
        }
        window.addEventListener('click', function(ev) {
            if (tapEv && tapEv.isDefaultPrevented()) {
                ev.stopPropagation();
                ev.preventDefault();
            }
        }, true);
        if ('ontouchstart' in window) {
            $window.on('touchstart', function(ev) {
                moved = false;
            }).on('touchmove', function() {
                moved = true;
            }).on('touchend', handleTap);
        } else {
            window.addEventListener('mouseup', handleTap, true);
        }
    }(jQuery));

We have both touch and mouse. So the flow is thus: the page loads with
ontouchstart being defined on window. So click, touchstart, touchmove, and
touchend are listening on window.

We click a header. mousdown, mouseup, click on the header node. The click is
captured, but ignored.

That's it.

Generally speaking, we try to convert mouse to touch when the mouse event isn't
handled, but only if there is a touch event listener on the node under the
cursor. Which there isn't.

I must confess I'm baffled at the window-wide listeners for something that
'click' provides much more efficiently. But maybe there's something IE-like
that makes this necessary.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to