cleanup List.js

This commit is contained in:
rolux 2013-05-15 09:30:31 +02:00
parent 697edd72a3
commit a84fa05d73

View file

@ -118,8 +118,7 @@ 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) ? {
@ -144,10 +143,13 @@ Ox.List = function(options, self) {
doubleclick: doubleclick doubleclick: doubleclick
}).on({ }).on({
touchend: function(e) { touchend: function(e) {
if(touchSelection.length && that.options('selected')[0] == touchSelection[0]) { if (
self.touchSelection.length
&& self.options.selected[0] == self.touchSelection[0]
) {
doubleclick(e); doubleclick(e);
} else { } else {
touchSelection = Ox.clone(that.options('selected')); self.touchSelection = Ox.clone(self.options.selected);
} }
} }
@ -210,7 +212,8 @@ Ox.List = function(options, self) {
preview: false, preview: false,
requests: [], requests: [],
scrollTimeout: 0, scrollTimeout: 0,
selected: [] selected: [],
touchSelection: []
}); });
if (!self.isAsync) { if (!self.isAsync) {
self.selected = self.options.items.map(function(item, i) { self.selected = self.options.items.map(function(item, i) {