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:
parent
d68bfa6b96
commit
bf8acbc6ab
|
@ -86,7 +86,7 @@ static NSArray *headers = nil;
|
||||||
- (id) init
|
- (id) init
|
||||||
{
|
{
|
||||||
if ((self = [super init]))
|
if ((self = [super init]))
|
||||||
currentIndex = 0;
|
currentIndex = -1;
|
||||||
|
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
@ -215,11 +215,14 @@ static NSArray *headers = nil;
|
||||||
|
|
||||||
- (NSString *) currentRowId
|
- (NSString *) currentRowId
|
||||||
{
|
{
|
||||||
|
[self nextId];
|
||||||
|
|
||||||
return [NSString stringWithFormat: @"row_%d", currentIndex];
|
return [NSString stringWithFormat: @"row_%d", currentIndex];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSString *) currentPopUpId
|
- (NSString *) currentPopUpId
|
||||||
{
|
{
|
||||||
|
|
||||||
return [NSString stringWithFormat: @"popup_%d", currentIndex];
|
return [NSString stringWithFormat: @"popup_%d", currentIndex];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -326,13 +329,4 @@ static NSArray *headers = nil;
|
||||||
return [to count] + [cc count] + [bcc count];
|
return [to count] + [cc count] + [bcc count];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (int) currentIndex
|
|
||||||
{
|
|
||||||
int count;
|
|
||||||
|
|
||||||
count = [self addressCount];
|
|
||||||
|
|
||||||
return count > 0 ? count - 1 : 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
@end /* UIxMailToSelection */
|
@end /* UIxMailToSelection */
|
||||||
|
|
|
@ -98,16 +98,15 @@ function fancyAddRow(shouldEdit, text) {
|
||||||
lastChild = $("lastRow");
|
lastChild = $("lastRow");
|
||||||
|
|
||||||
currentIndex++;
|
currentIndex++;
|
||||||
|
proto = lastChild.previous("tr");
|
||||||
proto = $('row_' + lastIndex);
|
|
||||||
row = proto.cloneNode(true);
|
row = proto.cloneNode(true);
|
||||||
row.id = 'row_' + currentIndex;
|
row.setAttribute("id", 'row_' + currentIndex);
|
||||||
|
|
||||||
// select popup
|
// select popup
|
||||||
var rowNodes = row.childNodesWithTag("td");
|
var rowNodes = row.childNodesWithTag("td");
|
||||||
select = $(rowNodes[0]).childNodesWithTag("select")[0];
|
select = $(rowNodes[0]).childNodesWithTag("select")[0];
|
||||||
select.name = 'popup_' + currentIndex;
|
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 = $(rowNodes[1]).childNodesWithTag("input")[0];
|
||||||
input.name = 'addr_' + currentIndex;
|
input.name = 'addr_' + currentIndex;
|
||||||
input.id = 'addr_' + currentIndex;
|
input.id = 'addr_' + currentIndex;
|
||||||
|
@ -147,7 +146,7 @@ function removeLastEditedRowIfEmpty() {
|
||||||
if (idx == 0) return;
|
if (idx == 0) return;
|
||||||
addr = $('addr_' + idx);
|
addr = $('addr_' + idx);
|
||||||
if (!addr) return;
|
if (!addr) return;
|
||||||
if (addr.value != '') return;
|
if (addr.value.strip() != '') return;
|
||||||
addr = this.findAddressWithIndex(idx);
|
addr = this.findAddressWithIndex(idx);
|
||||||
if(addr) {
|
if(addr) {
|
||||||
var addresses = $('addr_addresses');
|
var addresses = $('addr_addresses');
|
||||||
|
@ -223,5 +222,8 @@ function hasRecipients() {
|
||||||
return (count > 0)
|
return (count > 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* addressbook helpers */
|
function initMailToSelection() {
|
||||||
|
currentIndex = lastIndex = $$("table#addressList tr").length - 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
FastInit.addOnLoad(initMailToSelection);
|
||||||
|
|
Loading…
Reference in a new issue