merge of '6cff836762bb35cb6c26ae5eb215e6ff131d480d'

and 'edd8c9a9983a41fcee93052c706158aedf35f7c3'

Monotone-Parent: 6cff836762bb35cb6c26ae5eb215e6ff131d480d
Monotone-Parent: edd8c9a9983a41fcee93052c706158aedf35f7c3
Monotone-Revision: 2b28f6d0a82dd762775a558cb05973125df10b61

Monotone-Author: flachapelle@inverse.ca
Monotone-Date: 2010-12-03T22:34:21
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Francis Lachapelle
2010-12-03 22:34:21 +00:00
3 changed files with 29 additions and 6 deletions

View File

@@ -36,6 +36,15 @@
constructor for returning an NSData instance from a struct
SBinary_short.
2010-12-03 Francis Lachapelle <flachapelle@inverse.ca>
* UI/WebServerResources/MailerUI.js
(deleteSelectedMessagesCallback): must set the value of
lastClickedRow and lastClickedRowId when selecting the next row.
* UI/WebServerResources/HTMLElement.js (refreshSelectionByIds):
log invalid references to element IDs.
2010-12-02 Ludovic Marcotte <lmarcotte@inverse.ca>
* Main/SOGo+DAV.m - we avoid assuming a range is found

View File

@@ -249,7 +249,7 @@ Element.addMethods({
deselectAll: function(element) {
element = $(element);
if (element.tagName == 'TABLE') {
var tbody = element.down('TBODY');
var tbody = element.tBodies[0];
if (tbody)
element = tbody;
}
@@ -265,8 +265,16 @@ Element.addMethods({
if (element.selectedIds) {
for (var i = 0; i < element.selectedIds.length; i++) {
var e = element.down('#'+element.selectedIds[i]);
if (e && !e.hasClassName('_selected'))
e.addClassName('_selected');
if (e) {
if (!e.hasClassName('_selected'))
e.addClassName('_selected');
}
else {
log ("refreshSelectionByIds Error: " + element.tagName
+ " select by ID " + element.selectedIds[i]
+ " not found (" + element.childNodes.length + " children)");
element.selectedIds.splice(i,1);
}
}
}
},

View File

@@ -395,6 +395,7 @@ function deleteSelectedMessages(sender) {
var unseenCount = 0;
if (rowIds && rowIds.length > 0) {
messageList.deselectAll();
for (var i = 0; i < rowIds.length; i++) {
if (unseenCount < 1) {
var rows = messageList.select('#' + rowIds[i]);
@@ -408,13 +409,12 @@ function deleteSelectedMessages(sender) {
unseenCount = 1;
}
}
deleteMessageRequestCount++;
var uid = rowIds[i].substr(4); // drop "row_"
var path = Mailer.currentMailbox + "/" + uid;
uids.push(uid);
paths.push(path);
deleteMessageRequestCount++;
}
messageList.deselectAll();
updateMessageListCounter(0 - rowIds.length, true);
if (unseenCount < 0) {
var node = mailboxTree.getMailboxNode(Mailer.currentMailbox);
@@ -449,8 +449,9 @@ function deleteSelectedMessagesCallback(http) {
if (deleteMessageRequestCount == 0) {
// Select next message
var row = $("row_" + data["id"][i]);
var nextRow = false;
if (row) {
var nextRow = row.next("tr");
nextRow = row.next("tr");
if (!nextRow.id.startsWith('row_'))
nextRow = row.previous("tr");
// row.addClassName("deleted"); // when we'll offer "mark as deleted"
@@ -465,6 +466,11 @@ function deleteSelectedMessagesCallback(http) {
div.innerHTML = '';
}
Mailer.dataTable.remove(data["id"][i]);
if (nextRow) {
// from generic.js
lastClickedRow = nextRow.rowIndex;
lastClickedRowId = nextRow.id;
}
Mailer.dataTable.refresh();
deleteCachedMailboxByType("trash");
}