Make sure tab and shift-tab go through all recipients in the mail addressing widget, not just recipients that are scrolled into view. Bug 124304, r=ben, sr=hewitt.

git-svn-id: svn://10.0.0.236/trunk@119150 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
bryner%netscape.com
2002-04-16 21:58:53 +00:00
parent 20fa342f71
commit 53a85150d9
3 changed files with 41 additions and 1 deletions

View File

@@ -239,6 +239,8 @@ function OnLoadNewMailList()
AppendNewRowAndSetFocus();
awFitDummyRows(1);
document.addEventListener("keypress", awDocumentKeyPress, true);
// focus on first name
var listName = document.getElementById('ListName');
if ( listName )
@@ -313,6 +315,8 @@ function OnLoadEditList()
}
}
document.addEventListener("keypress", awDocumentKeyPress, true);
// workaround for bug 118337 - for mailing lists that have more rows than fits inside
// the display, the value of the textbox inside the new row isn't inherited into the input -
// the first row then appears to be duplicated at the end although it is actually empty.
@@ -560,4 +564,4 @@ function DropListAddress(target, address)
var lastInput = awGetInputElement(top.MAX_RECIPIENTS);
lastInput.value = address;
awAppendNewRow(true);
}
}

View File

@@ -1198,6 +1198,8 @@ function ComposeStartup(recycled, aParams)
var identityList = document.getElementById("msgIdentity");
var identityListPopup = document.getElementById("msgIdentityPopup");
document.addEventListener("keypress", awDocumentKeyPress, true);
if (identityListPopup)
FillIdentityListPopup(identityListPopup);

View File

@@ -682,6 +682,23 @@ function awTabFromRecipient(element, event)
//If we are le last element in the listbox, we don't want to create a new row.
if (element == awGetInputElement(top.MAX_RECIPIENTS))
top.doNotCreateANewRow = true;
var row = awGetRowByInputElement(element);
if (!event.shiftKey && row < top.MAX_RECIPIENTS) {
var listBoxRow = row - 1; // listbox row indices are 0-based, ours are 1-based.
var listBox = document.getElementById("addressingWidget");
listBox.listBoxObject.ensureIndexIsVisible(listBoxRow + 1);
}
}
function awTabFromMenulist(element, event)
{
var row = awGetRowByInputElement(element);
if (event.shiftKey && row > 1) {
var listBoxRow = row - 1; // listbox row indices are 0-based, ours are 1-based.
var listBox = document.getElementById("addressingWidget");
listBox.listBoxObject.ensureIndexIsVisible(listBoxRow - 1);
}
}
function awGetNumberOfRecipients()
@@ -847,6 +864,15 @@ function awKeyDown(event, listboxElement)
}
}
function awMenulistKeyPress(event, element)
{
switch(event.keyCode) {
case 9:
awTabFromMenulist(element, event);
break;
}
}
/* ::::::::::: addressing widget dummy rows ::::::::::::::::: */
var gAWContentHeight = 0;
@@ -955,3 +981,11 @@ function awSizerMouseUp()
document.removeEventListener("mouseup", awSizerMouseUp, false);
}
function awDocumentKeyPress(event)
{
try {
var id = event.target.getAttribute('id');
if (id.substr(0, 11) == 'addressCol1')
awMenulistKeyPress(event, event.target);
} catch (e) { }
}