From 3397ca671193211fab1c2889f7da1a78a676008e Mon Sep 17 00:00:00 2001 From: "neil%parkwaycc.co.uk" Date: Wed, 2 Apr 2003 08:18:00 +0000 Subject: [PATCH] Bug 194945 Caret isn't present when toggling to a composer window r=brade sr=jag git-svn-id: svn://10.0.0.236/trunk@140574 18797224-902f-48f8-a5cc-f745e15eee43 --- .../resources/content/tasksOverlay.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/mozilla/xpfe/communicator/resources/content/tasksOverlay.js b/mozilla/xpfe/communicator/resources/content/tasksOverlay.js index ee397c1ddea..773cc08ff01 100644 --- a/mozilla/xpfe/communicator/resources/content/tasksOverlay.js +++ b/mozilla/xpfe/communicator/resources/content/tasksOverlay.js @@ -84,6 +84,11 @@ function toJavaConsole() jvmMgr.showJavaConsole(); } +function toOpenWindow( aWindow ) +{ + aWindow.document.commandDispatcher.focusedWindow.focus(); +} + function toOpenWindowByType( inType, uri ) { var windowManager = Components.classes['@mozilla.org/appshell/window-mediator;1'].getService(); @@ -93,7 +98,7 @@ function toOpenWindowByType( inType, uri ) var topWindow = windowManagerInterface.getMostRecentWindow( inType ); if ( topWindow ) - topWindow.focus(); + toOpenWindow(topWindow); else window.open(uri, "_blank", "chrome,extrachrome,menubar,resizable,scrollbars,status,toolbar"); } @@ -138,7 +143,7 @@ function CycleWindow( aType ) return null; if ( topWindowOfType != topWindow ) { - topWindowOfType.focus(); + toOpenWindow(topWindowOfType); return topWindowOfType; } @@ -150,14 +155,14 @@ function CycleWindow( aType ) if (enumerator.hasMoreElements()) { iWindow = enumerator.getNext().QueryInterface(nsIDOMWindowInternal); - iWindow.focus(); + toOpenWindow(iWindow); return iWindow; } if (firstWindow == topWindow) // Only one window return null; - firstWindow.focus(); + toOpenWindow(firstWindow); return firstWindow; } @@ -170,7 +175,7 @@ function ShowWindowFromResource( node ) desiredWindow = windowManagerDS.getWindowForResource( url ); if ( desiredWindow ) { - desiredWindow.focus(); + toOpenWindow(desiredWindow); } }