1
0
Fork 0
forked from 0x2620/oxjs

listmap bugfixes

This commit is contained in:
rolux 2011-05-24 18:08:52 +02:00
commit 9967d31396
2 changed files with 21 additions and 10 deletions

View file

@ -1080,6 +1080,7 @@ Ox.List = function(options, self) {
function setSelected(ids) {
// fixme: can't use selectNone here,
// since it'd trigger a select event
Ox.print('setSelected', ids)
self.$items.forEach(function($item, pos) {
if (isSelected(pos)) {
self.selected.splice(self.selected.indexOf(pos), 1);
@ -1089,6 +1090,7 @@ Ox.List = function(options, self) {
});
ids.forEach(function(id, i) {
var pos = getPositionById(id);
Ox.print('pushing', pos, 'onto self.selected')
self.selected.push(pos);
!Ox.isUndefined(self.$items[pos]) &&
self.$items[pos].addClass('OxSelected');
@ -1217,6 +1219,7 @@ Ox.List = function(options, self) {
}
function updateSelected() {
Ox.print('updateSelected')
var oldSelectedIds = getSelectedIds(),
newSelectedIds = [];
Ox.forEach(self.options.items, function(item) {