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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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) { }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user