fix lists select bug

This commit is contained in:
rlx 2011-01-13 21:48:39 +00:00
parent 4428ad4d5c
commit 73e6ce7292

View file

@ -6923,37 +6923,21 @@ requires
}
function setSelected(ids) {
if (ids.length == 0) {
// fixme: can't use selectNone here,
// since it'd trigger a select event
$.each(self.$items, function(pos) {
if (isSelected(pos)) {
self.selected.splice(self.selected.indexOf(pos), 1);
!Ox.isUndefined(self.$items[pos]) &&
self.$items[pos].removeClass('OxSelected');
}
});
} else {
ids.forEach(function(id, i) {
var pos = getPositionById(id);
select(pos);
});
}
// fixme: implement the rest of this
/*
self.selected.forEach(function(pos) {
if (value.indexOf(self.ids[pos]) == -1) {
deselect(pos);
}
// fixme: can't use selectNone here,
// since it'd trigger a select event
$.each(self.$items, function(pos) {
if (isSelected(pos)) {
self.selected.splice(self.selected.indexOf(pos), 1);
!Ox.isUndefined(self.$items[pos]) &&
self.$items[pos].removeClass('OxSelected');
}
});
value.forEach(function(id) {
if (self.ids.indexOf(id) > -1) {
addToSelection(pos)
} else {
}
ids.forEach(function(id, i) {
var pos = getPositionById(id);
self.selected.push(pos);
!Ox.isUndefined(self.$items[pos]) &&
self.$items[pos].addClass('OxSelected');
});
*/
}
function toggleSelection(pos) {