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
This commit is contained in:
parent
cdd29f1a4b
commit
697edd72a3
1 changed files with 11 additions and 1 deletions
|
@ -118,7 +118,8 @@ Ox.List = function(options, self) {
|
||||||
updateSort();
|
updateSort();
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.scroll(scroll);
|
.scroll(scroll),
|
||||||
|
touchSelection = [];
|
||||||
|
|
||||||
self.options.sort = self.options.sort.map(function(sort) {
|
self.options.sort = self.options.sort.map(function(sort) {
|
||||||
return Ox.isString(sort) ? {
|
return Ox.isString(sort) ? {
|
||||||
|
@ -141,6 +142,15 @@ Ox.List = function(options, self) {
|
||||||
mousedown: mousedown,
|
mousedown: mousedown,
|
||||||
singleclick: singleclick,
|
singleclick: singleclick,
|
||||||
doubleclick: doubleclick
|
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) {
|
if (self.options.draggable) {
|
||||||
that.$content.bindEvent({
|
that.$content.bindEvent({
|
||||||
|
|
Loading…
Reference in a new issue