* It's required that "currentIndex" is defined in a top level context.
*
* Exports:
- * defines UIxRecipientSelectorHasRecipients() returning a bool for the
+ * defines hasRecipients() returning a bool for the
* surrounding context to check.
*/
return;
}
}
- addressList = $("addressList");
+ addressList = $("addressList").tBodies[0];
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("span");
+ 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;
input.select();
input.setAttribute('autocomplete', 'on');
}
-// this.adjustInlineAttachmentListHeight(this);
}
function addressFieldGotFocus(sender) {
var idx;
idx = this.getIndexFromIdentifier(sender.id);
- if ((lastIndex == idx) || (idx == 0)) return;
+ if (lastIndex == idx) return;
this.removeLastEditedRowIfEmpty();
+ onWindowResize(null);
return false;
}
function addressFieldLostFocus(sender) {
lastIndex = this.getIndexFromIdentifier(sender.id);
-
+
return false;
}
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');
addresses.removeChild(addr);
}
- addressList = $("addressList");
+ addressList = $("addressList").tBodies[0];
senderRow = $("row_" + idx);
addressList.removeChild(senderRow);
- this.adjustInlineAttachmentListHeight(this);
}
function findAddressWithIndex(idx) {
addressIDs = new Array();
- addressList = $("addressList");
+ addressList = $("addressList").tBodies[0];
rows = addressList.childNodes;
count = rows.length;
for (i = 0; i < count; i++) {
var row, rowId;
- row = addressList.childNodes[i];
+ row = rows[i];
rowId = row.id;
- if (rowId && rowId != 'row_last') {
+ if (rowId && rowId != 'lastRow') {
var idx;
idx = this.getIndexFromIdentifier(rowId);
return addressCount;
}
-function UIxRecipientSelectorHasRecipients() {
+function hasRecipients() {
var count;
count = this.getAddressCount();
- if (count > 0)
- return true;
- return false;
-}
-function adjustInlineAttachmentListHeight(sender) {
- var e;
-
- e = $('attachmentsArea');
- if (e.style.display != 'none') {
- /* need to lower left size first, because left auto-adjusts to right! */
- xHeight('compose_attachments_list', 10);
-
- var leftHeight, rightHeaderHeight;
- leftHeight = xHeight('compose_leftside');
- rightHeaderHeight = xHeight('compose_attachments_header');
- xHeight('compose_attachments_list',
- (leftHeight - rightHeaderHeight) - 16);
- }
+ return (count > 0)
}
-/* addressbook helpers */
+function initMailToSelection() {
+ currentIndex = lastIndex = $$("table#addressList tr").length - 2;
+}
+FastInit.addOnLoad(initMailToSelection);