From 8db20baa1d88739dbcff481effb73b8d82b03716 Mon Sep 17 00:00:00 2001 From: "sspitzer%netscape.com" Date: Fri, 17 Jan 2003 02:45:38 +0000 Subject: [PATCH] fix for bug #90539. delete key doesn't work in the stand alone msg window (unless you open the edit menu). also, set focus to the message pane in the stand alone msg window so the arrow keys (and other things) work right away. r/sr=bienvenu --- .../content/mail3PaneWindowCommands.js | 3 +++ .../base/resources/content/messageWindow.js | 22 +++++++++++++++---- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/mailnews/base/resources/content/mail3PaneWindowCommands.js b/mailnews/base/resources/content/mail3PaneWindowCommands.js index d76f43a95196..5f5b73586978 100644 --- a/mailnews/base/resources/content/mail3PaneWindowCommands.js +++ b/mailnews/base/resources/content/mail3PaneWindowCommands.js @@ -754,6 +754,9 @@ function FocusRingUpdate_Mail() gLastFocusedElement = currentFocusedElement; // since we just changed the pane with focus we need to update the toolbar to reflect this + // XXX TODO + // can we optimize + // and just update cmd_delete and button_delete? UpdateMailToolbar("focus"); } } diff --git a/mailnews/base/resources/content/messageWindow.js b/mailnews/base/resources/content/messageWindow.js index 14908a41e6bb..3ac1d540a052 100644 --- a/mailnews/base/resources/content/messageWindow.js +++ b/mailnews/base/resources/content/messageWindow.js @@ -271,12 +271,26 @@ function OnLoadMessageWindow() CreateView(originalView) - setTimeout("var msgKey = extractMsgKeyFromURI(gCurrentMessageUri); gDBView.loadMessageByMsgKey(msgKey); gNextMessageViewIndexAfterDelete = gDBView.msgToSelectAfterDelete; UpdateStandAloneMessageCounts();", 0); + setTimeout(OnLoadMessageWindowDelayed, 0); SetupCommandUpdateHandlers(); - var messagePaneFrame = top.frames['messagepane']; - if (messagePaneFrame) - messagePaneFrame.focus(); +} + +function OnLoadMessageWindowDelayed() +{ + var msgKey = extractMsgKeyFromURI(gCurrentMessageUri); + gDBView.loadMessageByMsgKey(msgKey); + gNextMessageViewIndexAfterDelete = gDBView.msgToSelectAfterDelete; + UpdateStandAloneMessageCounts(); + + // set focus to the message pane + window.content.focus(); + + // since we just changed the pane with focus we need to update the toolbar to reflect this + // XXX TODO + // can we optimize + // and just update cmd_delete and button_delete? + UpdateMailToolbar("focus"); } function CreateView(originalView)