See Changelog

Monotone-Parent: 9122e2216d8964993594986341641fdaf0eef5bd
Monotone-Revision: b7e9891a078226bf2611b1f6b38c2ef5495ef405

Monotone-Author: flachapelle@inverse.ca
Monotone-Date: 2011-03-10T20:42:02
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Francis Lachapelle
2011-03-10 20:42:02 +00:00
parent eebb4b9e8a
commit c4c472eeef
2 changed files with 23 additions and 2 deletions

View File

@@ -1,3 +1,9 @@
2011-03-10 Francis Lachapelle <flachapelle@inverse.ca>
* UI/WebServerResources/ContactsUI.js
(onCategoriesMenuItemCallback): new callback that refreshes the
displayed card when a category is added or removed.
2011-03-10 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* UI/WebServerResources/ContactsUI.js (onCategoriesMenuItemClick):

View File

@@ -1338,12 +1338,12 @@ function onCategoriesMenuItemClick() {
var contactsList = $("contactsList");
var rowIds = contactsList.getSelectedRowsId();
if (rowIds.length > 0) {
log("coucou...");
for (var i = 0; i < rowIds.length; i++) {
var url = (URLForFolderID(Contact.currentAddressBook)
+ "/" + rowIds[i] + "/" + method);
url += "?category=" + encodeURIComponent(this.category);
triggerAjaxRequest(url);
triggerAjaxRequest(url, onCategoriesMenuItemCallback,
{ 'addressBook' : Contact.currentAddressBook, 'id' : rowIds[i] });
if (set) {
setCategoryOnNode($(rowIds[i]), this.category);
}
@@ -1354,6 +1354,21 @@ function onCategoriesMenuItemClick() {
}
}
function onCategoriesMenuItemCallback(http) {
if (http.readyState == 4)
if (isHttpStatus204(http.status)) {
var contact = http.callbackData;
if (cachedContacts[contact.addressBook + "/" + contact.id])
delete cachedContacts[contact.addressBook + "/" + contact.id];
if (contact.addressBook == Contact.currentAddressBook
&& contact.id == Contact.currentContact)
loadContact(Contact.currentContact);
}
else {
log("onCategoriesMenuItemCallback failed: error " + http.status + " (" + http.responseText + ")");
}
}
function setCategoryOnNode(contactNode, category) {
var catList = contactNode.getAttribute("categories");
var catsArray = catList.split(",");