Bug 702484 - Remove RestoreFocusAfterHdrButton function. r=aleca

Differential Revision: https://phabricator.services.mozilla.com/D160571

--HG--
extra : amend_source : 8cbf7a2f337b2e9cd4eca3b02e1a6e51a4aa9510
This commit is contained in:
Elizabeth Mitchell 2022-11-06 21:28:03 +11:00
Родитель a51ccf10ac
Коммит 7ee72c373e
6 изменённых файлов: 24 добавлений и 53 удалений

Просмотреть файл

@ -224,11 +224,6 @@ function GetSelectedMsgFolders() {
return [];
}
function RestoreFocusAfterHdrButton() {
// set focus to the message pane
content.focus();
}
var preferenceObserver = {
QueryInterface: ChromeUtils.generateQI(["nsIObserver"]),

Просмотреть файл

@ -1267,22 +1267,6 @@ function FocusRingUpdate_Mail() {
}
}
function RestoreFocusAfterHdrButton() {
// Note: Some callers call this function *after* asynchronous functions like
// save-as which will trigger a save dialog. As those dialogs are typically
// slower to load, in reality this function may set focus on thread pane
// *before* the dialog is shown on screen. This does not seem to cause
// problems like dialogs being hidden behind the main window, probably because
// they're application-modal OS dialogs and will ensure having focus anyway.
//
// I would love to really restore the focus to the pane that had
// focus before the user clicked on the hdr button, and gLastFocusedElement
// would almost do that, except that clicking on the hdr button sets
// gLastFocusedElement to the message pane. What I need is
// gPenultimateFocusedElement.
SetFocusThreadPane();
}
function SetupCommandUpdateHandlers() {
// folder pane
var widget = document.getElementById("folderTree");

Просмотреть файл

@ -1470,11 +1470,6 @@ function getMailToolbox() {
return document.getElementById("mail-toolbox");
}
function RestoreFocusAfterHdrButton() {
// set focus to the message pane
window.content.focus();
}
function SelectFolder(aFolderUri) {
gFolderDisplay.clearSelection();
gFolderDisplay.treeSelection.currentIndex = -1;

Просмотреть файл

@ -41,25 +41,25 @@
label="&saveAttachmentButton1.label;"
tooltiptext="&saveAttachmentButton1.tooltip;"
onclick="event.stopPropagation();"
oncommand="TryHandleAllAttachments('saveAs'); RestoreFocusAfterHdrButton();"
oncommand="TryHandleAllAttachments('saveAs');"
hidden="true">
<menupopup id="attachmentSaveAllSingleMenu"
onpopupshowing="onShowSaveAttachmentMenuSingle();">
<menuitem id="button-openAttachment"
oncommand="TryHandleAllAttachments('open'); event.stopPropagation(); RestoreFocusAfterHdrButton();"
oncommand="TryHandleAllAttachments('open'); event.stopPropagation();"
label="&openAttachmentCmd.label;"
accesskey="&openAttachmentCmd.accesskey;"/>
<menuitem id="button-saveAttachment"
oncommand="TryHandleAllAttachments('saveAs'); event.stopPropagation(); RestoreFocusAfterHdrButton();"
oncommand="TryHandleAllAttachments('saveAs'); event.stopPropagation();"
label="&saveAsAttachmentCmd.label;"
accesskey="&saveAsAttachmentCmd.accesskey;"/>
<menuseparator id="button-menu-separator"/>
<menuitem id="button-detachAttachment"
oncommand="TryHandleAllAttachments('detach'); event.stopPropagation(); RestoreFocusAfterHdrButton();"
oncommand="TryHandleAllAttachments('detach'); event.stopPropagation();"
label="&detachAttachmentCmd.label;"
accesskey="&detachAttachmentCmd.accesskey;"/>
<menuitem id="button-deleteAttachment"
oncommand="TryHandleAllAttachments('delete'); event.stopPropagation(); RestoreFocusAfterHdrButton();"
oncommand="TryHandleAllAttachments('delete'); event.stopPropagation();"
label="&deleteAttachmentCmd.label;"
accesskey="&deleteAttachmentCmd.accesskey;"/>
</menupopup>
@ -70,24 +70,24 @@
label="&saveAllAttachmentsButton1.label;"
tooltiptext="&saveAllAttachmentsButton1.tooltip;"
onclick="event.stopPropagation();"
oncommand="TryHandleAllAttachments('save'); RestoreFocusAfterHdrButton();">
oncommand="TryHandleAllAttachments('save');">
<menupopup id="attachmentSaveAllMultipleMenu"
onpopupshowing="onShowSaveAttachmentMenuMultiple();">
<menuitem id="button-openAllAttachments"
oncommand="TryHandleAllAttachments('open'); event.stopPropagation(); RestoreFocusAfterHdrButton();"
oncommand="TryHandleAllAttachments('open'); event.stopPropagation();"
label="&openAllAttachmentsCmd.label;"
accesskey="&openAllAttachmentsCmd.accesskey;"/>
<menuitem id="button-saveAllAttachments"
oncommand="TryHandleAllAttachments('save'); event.stopPropagation(); RestoreFocusAfterHdrButton();"
oncommand="TryHandleAllAttachments('save'); event.stopPropagation();"
label="&saveAllAttachmentsCmd.label;"
accesskey="&saveAllAttachmentsCmd.accesskey;"/>
<menuseparator id="button-menu-separator-all"/>
<menuitem id="button-detachAllAttachments"
oncommand="TryHandleAllAttachments('detach'); event.stopPropagation(); RestoreFocusAfterHdrButton();"
oncommand="TryHandleAllAttachments('detach'); event.stopPropagation();"
label="&detachAllAttachmentsCmd.label;"
accesskey="&detachAllAttachmentsCmd.accesskey;"/>
<menuitem id="button-deleteAllAttachments"
oncommand="TryHandleAllAttachments('delete'); event.stopPropagation(); RestoreFocusAfterHdrButton();"
oncommand="TryHandleAllAttachments('delete'); event.stopPropagation();"
label="&deleteAllAttachmentsCmd.label;"
accesskey="&deleteAllAttachmentsCmd.accesskey;"/>
</menupopup>

Просмотреть файл

@ -24,7 +24,7 @@
<hbox id="header-view-toolbar" class="header-buttons-container themeable-brighttext">
<toolbarbutton id="hdrReplyToSenderButton" label="&hdrReplyButton1.label;"
tooltiptext="&hdrReplyButton2.tooltip;"
oncommand="MsgReplySender(event); RestoreFocusAfterHdrButton();"
oncommand="MsgReplySender(event);"
observes="button_reply"
class="toolbarbutton-1 message-header-view-button hdrReplyToSenderButton"/>
@ -38,7 +38,7 @@
<toolbarbutton id="hdrReplyButton" label="&hdrReplyButton1.label;"
tooltiptext="&hdrReplyButton2.tooltip;"
oncommand="MsgReplySender(event); RestoreFocusAfterHdrButton();"
oncommand="MsgReplySender(event);"
observes="button_reply"
class="toolbarbutton-1 message-header-view-button hdrReplyButton"/>
@ -46,7 +46,7 @@
type="menu-button"
label="&hdrReplyAllButton1.label;"
tooltiptext="&hdrReplyAllButton1.tooltip;"
oncommand="MsgReplyToAllMessage(event); RestoreFocusAfterHdrButton();"
oncommand="MsgReplyToAllMessage(event);"
observes="button_replyall"
class="toolbarbutton-1 message-header-view-button hdrReplyButton hdrReplyAllButton"
hidden="true">
@ -63,7 +63,7 @@
label="&hdrReplyButton1.label;"
tooltiptext="&hdrReplyButton2.tooltip;"
observes="button_reply"
oncommand="MsgReplySender(event); event.stopPropagation(); RestoreFocusAfterHdrButton();"/>
oncommand="MsgReplySender(event); event.stopPropagation();"/>
</menupopup>
</toolbarbutton>
@ -71,7 +71,7 @@
type="menu-button"
label="&hdrReplyListButton1.label;"
tooltiptext="&hdrReplyListButton1.tooltip;"
oncommand="MsgReplyToListMessage(event); RestoreFocusAfterHdrButton();"
oncommand="MsgReplyToListMessage(event);"
observes="button_replylist"
class="toolbarbutton-1 message-header-view-button hdrReplyButton hdrReplyListButton"
hidden="true">
@ -88,15 +88,13 @@
label="&hdrReplyAllButton1.label;"
tooltiptext="&hdrReplyAllButton1.tooltip;"
observes="button_replyall"
oncommand="MsgReplyToAllMessage(event); event.stopPropagation();
RestoreFocusAfterHdrButton();"/>
oncommand="MsgReplyToAllMessage(event); event.stopPropagation();"/>
<menuitem id="hdrReplyList_ReplySubButton"
class="menuitem-iconic"
label="&hdrReplyButton1.label;"
tooltiptext="&hdrReplyButton2.tooltip;"
observes="button_reply"
oncommand="MsgReplySender(event); event.stopPropagation();
RestoreFocusAfterHdrButton();"/>
oncommand="MsgReplySender(event); event.stopPropagation();"/>
</menupopup>
</toolbarbutton>
@ -104,7 +102,7 @@
label="&hdrFollowupButton1.label;"
type="menu-button"
tooltiptext="&hdrFollowupButton1.tooltip;"
oncommand="MsgReplyGroup(event); RestoreFocusAfterHdrButton();"
oncommand="MsgReplyGroup(event);"
observes="button_followup"
class="toolbarbutton-1 message-header-view-button hdrFollowupButton">
<menupopup id="hdrFollowupDropdown"
@ -120,13 +118,13 @@
label="&hdrReplyAllButton1.label;"
tooltiptext="&hdrReplyAllButton1.tooltip;"
observes="button_replyall"
oncommand="MsgReplyToAllMessage(event); event.stopPropagation(); RestoreFocusAfterHdrButton();"/>
oncommand="MsgReplyToAllMessage(event); event.stopPropagation();"/>
<menuitem id="hdrFollowup_ReplySubButton"
class="menuitem-iconic"
label="&hdrReplyButton1.label;"
tooltiptext="&hdrReplyButton2.tooltip;"
observes="button_reply"
oncommand="MsgReplySender(event); event.stopPropagation(); RestoreFocusAfterHdrButton();"/>
oncommand="MsgReplySender(event); event.stopPropagation();"/>
</menupopup>
</toolbarbutton>
</toolbaritem>
@ -134,26 +132,26 @@
<toolbarbutton id="hdrForwardButton"
label="&hdrForwardButton1.label;"
tooltiptext="&hdrForwardButton1.tooltip;"
oncommand="MsgForwardMessage(event); RestoreFocusAfterHdrButton();"
oncommand="MsgForwardMessage(event);"
observes="button_forward"
class="toolbarbutton-1 message-header-view-button hdrForwardButton"/>
<toolbarbutton id="hdrArchiveButton"
label="&hdrArchiveButton1.label;"
tooltiptext="&hdrArchiveButton1.tooltip;"
oncommand="MsgArchiveSelectedMessages(event); RestoreFocusAfterHdrButton();"
oncommand="MsgArchiveSelectedMessages(event);"
observes="button_archive"
class="toolbarbutton-1 message-header-view-button hdrArchiveButton"/>
<toolbarbutton id="hdrJunkButton" label="&hdrJunkButton1.label;"
tooltiptext="&hdrJunkButton1.tooltip;"
observes="button_junk"
class="toolbarbutton-1 message-header-view-button hdrJunkButton"
oncommand="goDoCommand('button_junk'); RestoreFocusAfterHdrButton();"/>
oncommand="goDoCommand('button_junk');"/>
<toolbarbutton id="hdrTrashButton"
label="&hdrTrashButton1.label;"
tooltiptext="&hdrTrashButton1.tooltip;"
observes="button_delete"
class="toolbarbutton-1 message-header-view-button hdrTrashButton"
oncommand="goDoCommand(event.shiftKey ? 'button_shiftDelete' : 'button_delete'); RestoreFocusAfterHdrButton();"/>
oncommand="goDoCommand(event.shiftKey ? 'button_shiftDelete' : 'button_delete');"/>
<toolbarbutton id="otherActionsButton"
type="menu"
wantdropmarker="true"

Просмотреть файл

@ -2833,7 +2833,6 @@ function OpenAttachmentFromBar(event) {
if (event.detail == 1) {
TryHandleAllAttachments("open");
}
RestoreFocusAfterHdrButton();
event.stopPropagation();
}
}