Bug 808501 - Focusing chat bar doesn't put focus back in the previously focused chat. r=markh
authorJared Wein <jwein@mozilla.com>
Wed, 14 Nov 2012 16:11:09 -0800
changeset 113315 e9c9d1ff7a15dce5c271a4bd63c60a97dbd264af
parent 113314 d3a58eacf6dfe4e939c78883871eaf0cd9704677
child 113316 c62f85640fc362de486ee3776d485cae8a6d4e9c
push id23869
push useremorley@mozilla.com
push dateThu, 15 Nov 2012 16:18:16 +0000
treeherdermozilla-central@a37525d304d9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmarkh
bugs808501
milestone19.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 808501 - Focusing chat bar doesn't put focus back in the previously focused chat. r=markh
browser/base/content/browser-social.js
--- a/browser/base/content/browser-social.js
+++ b/browser/base/content/browser-social.js
@@ -249,18 +249,20 @@ let SocialChatBar = {
   update: function() {
     if (!this.isAvailable)
       this.chatbar.removeAll();
     else {
       this.chatbar.hidden = document.mozFullScreen;
     }
   },
   focus: function SocialChatBar_focus() {
+    if (!this.chatbar.selectedChat)
+      return;
     let commandDispatcher = gBrowser.ownerDocument.commandDispatcher;
-    commandDispatcher.advanceFocusIntoSubtree(this.chatbar);
+    commandDispatcher.advanceFocusIntoSubtree(this.chatbar.selectedChat);
   }
 }
 
 function sizeSocialPanelToContent(panel, iframe) {
   // FIXME: bug 764787: Maybe we can use nsIDOMWindowUtils.getRootBounds() here?
   let doc = iframe.contentDocument;
   if (!doc || !doc.body) {
     return;