related with bug #0724. Erase rows before ajax call.

For a better user experience, first erase (hide) the rows that were
deleted. Then make the ajax call for batchdelete. On confirmation
really delete the rows.
This commit is contained in:
Luc Charland
2012-10-12 13:34:38 -04:00
parent 854985e124
commit b1547d7212
+3 -3
View File
@@ -493,9 +493,8 @@ function onToolbarDeleteSelectedContactsConfirm(dialogId) {
var contactsList = $('contactsList');
var rowIds = contactsList.getSelectedRowsId();
var urlstr = (URLForFolderID(Contact.currentAddressBook) + "/batchDelete");
for (var i = 0; i < rowIds.length; i++) {
delete cachedContacts[Contact.currentAddressBook + "/" + rowIds[i]];
}
for (var i = 0; i < rowIds.length; i++)
$(rowIds[i]).hide();
triggerAjaxRequest(urlstr, onContactDeleteEventCallback, rowIds,
('ids=' + rowIds.join("/")),
{ "Content-type": "application/x-www-form-urlencoded" });
@@ -508,6 +507,7 @@ function onContactDeleteEventCallback(http) {
var row;
var nextRow = null;
for (var i = 0; i < rowIds.length; i++) {
delete cachedContacts[Contact.currentAddressBook + "/" + rowIds[i]];
row = $(rowIds[i]);
var displayName = row.readAttribute("contactname");
if (Contact.currentContactId == row) {