Monotone-Parent: a311d7d0d46a40428355d5d16855425659aafddf

Monotone-Revision: 0dd67af506445aca2871edc97a4383c609e20c42

Monotone-Author: flachapelle@inverse.ca
Monotone-Date: 2007-12-04T22:47:41
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Francis Lachapelle 2007-12-04 22:47:41 +00:00
parent d68bfa6b96
commit bf8acbc6ab
2 changed files with 13 additions and 17 deletions

View file

@ -86,7 +86,7 @@ static NSArray *headers = nil;
- (id) init
{
if ((self = [super init]))
currentIndex = 0;
currentIndex = -1;
return self;
}
@ -215,11 +215,14 @@ static NSArray *headers = nil;
- (NSString *) currentRowId
{
[self nextId];
return [NSString stringWithFormat: @"row_%d", currentIndex];
}
- (NSString *) currentPopUpId
{
return [NSString stringWithFormat: @"popup_%d", currentIndex];
}
@ -326,13 +329,4 @@ static NSArray *headers = nil;
return [to count] + [cc count] + [bcc count];
}
- (int) currentIndex
{
int count;
count = [self addressCount];
return count > 0 ? count - 1 : 0;
}
@end /* UIxMailToSelection */

View file

@ -98,16 +98,15 @@ function fancyAddRow(shouldEdit, text) {
lastChild = $("lastRow");
currentIndex++;
proto = $('row_' + lastIndex);
proto = lastChild.previous("tr");
row = proto.cloneNode(true);
row.id = 'row_' + currentIndex;
row.setAttribute("id", 'row_' + currentIndex);
// select popup
var rowNodes = row.childNodesWithTag("td");
select = $(rowNodes[0]).childNodesWithTag("select")[0];
select.name = 'popup_' + currentIndex;
// select.value = row.childNodesWithTag("span")[0].childNodesWithTag("select")[0].value;
select.value = proto.down("select").value;
input = $(rowNodes[1]).childNodesWithTag("input")[0];
input.name = 'addr_' + currentIndex;
input.id = 'addr_' + currentIndex;
@ -136,7 +135,7 @@ function addressFieldGotFocus(sender) {
function addressFieldLostFocus(sender) {
lastIndex = this.getIndexFromIdentifier(sender.id);
return false;
}
@ -147,7 +146,7 @@ function removeLastEditedRowIfEmpty() {
if (idx == 0) return;
addr = $('addr_' + idx);
if (!addr) return;
if (addr.value != '') return;
if (addr.value.strip() != '') return;
addr = this.findAddressWithIndex(idx);
if(addr) {
var addresses = $('addr_addresses');
@ -223,5 +222,8 @@ function hasRecipients() {
return (count > 0)
}
/* addressbook helpers */
function initMailToSelection() {
currentIndex = lastIndex = $$("table#addressList tr").length - 2;
}
FastInit.addOnLoad(initMailToSelection);