From 697edd72a32fe195998cdaa0fc4990cb95cf0ef2 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Tue, 14 May 2013 17:12:44 +0000 Subject: [PATCH] List.js trigger doubleclick event on touchend if selection was not changed this allows list navigation for mobile devices that have not double click. tested on Android 4 in Chrome, Firefox and Android Browser --- source/Ox.UI/js/List/List.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/source/Ox.UI/js/List/List.js b/source/Ox.UI/js/List/List.js index 6490d4d2..55a92e89 100644 --- a/source/Ox.UI/js/List/List.js +++ b/source/Ox.UI/js/List/List.js @@ -118,7 +118,8 @@ Ox.List = function(options, self) { updateSort(); } }) - .scroll(scroll); + .scroll(scroll), + touchSelection = []; self.options.sort = self.options.sort.map(function(sort) { return Ox.isString(sort) ? { @@ -141,6 +142,15 @@ Ox.List = function(options, self) { mousedown: mousedown, singleclick: singleclick, doubleclick: doubleclick + }).on({ + touchend: function(e) { + if(touchSelection.length && that.options('selected')[0] == touchSelection[0]) { + doubleclick(e); + } else { + touchSelection = Ox.clone(that.options('selected')); + } + } + }); if (self.options.draggable) { that.$content.bindEvent({