fix a bug where after moving items, there number would be subtracted from the lists totals twice

This commit is contained in:
rlx 2011-09-04 11:31:05 +00:00
parent 93fed09f18
commit cfb2941c68
2 changed files with 5 additions and 11 deletions

View File

@ -181,7 +181,9 @@ pandora.reloadList = function() {
});
pandora.$ui.list.bindEvent({
init: function(event, data) {
var folder = listData.status == 'private' ? 'personal' : listData.status;
// fixme: this will not work for lists in the favorites folder
// (but then it's also unlikely they'll have to be reloaded)
var folder = listData.status != 'featured' ? 'personal' : 'featured';
pandora.$ui.folderList[folder].value(listData.id, 'items', data.items);
}
})

View File

@ -702,16 +702,8 @@ pandora.ui.list = function() { // fixme: remove view argument
operator: ''
}
}, function(result) {
var folder;
if (drag.action == 'move') {
folder = drag.source.status != 'featured' ? 'personal' : 'featured';
pandora.$ui.folderList[folder].value(
drag.source.id, 'items',
pandora.$ui.folderList[folder].value(drag.source.id, 'items') - data.ids.length
);
}
folder = drag.target.status != 'featured' ? 'personal' : 'featured';
Ox.print(drag.source.status, '//////', drag.target.status)
var folder = drag.target.status != 'featured' ? 'personal' : 'featured';
//Ox.print(drag.source.status, '//////', drag.target.status)
pandora.$ui.folderList[folder].value(
drag.target.id, 'items',
result.data.items