From dec674fae2d7c2068d6f62904d63899e42bf06e9 Mon Sep 17 00:00:00 2001 From: JC Brand Date: Thu, 24 Apr 2014 19:39:03 +0200 Subject: [PATCH] Bugfix. Opened chatboxes weren't focused... ...when clicking on a contact in the roster --- converse.js | 3 ++- spec/chatbox.js | 23 +++++++++++++++++++++-- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/converse.js b/converse.js index 057f9aa36..3c4a4e5ce 100644 --- a/converse.js +++ b/converse.js @@ -1479,11 +1479,12 @@ this.$el.hide('fast', converse.refreshWebkit); converse.emit('onChatBoxClosed', this); } + return this; }, show: function (callback) { if (this.$el.is(':visible') && this.$el.css('opacity') == "1") { - return this; + return this.focus(); } this.$el.show(callback); if (converse.connection) { diff --git a/spec/chatbox.js b/spec/chatbox.js index 7639acb4a..b7d75671b 100644 --- a/spec/chatbox.js +++ b/spec/chatbox.js @@ -35,7 +35,7 @@ // visible, but no other chat boxes have been created. expect(this.chatboxes.length).toEqual(1); - var online_contacts = this.rosterview.$el.find('dt#xmpp-contacts').siblings('dd.current-xmpp-contact.online').find('a.open-chat'); + var online_contacts = this.rosterview.$el.find('dt#xmpp-contacts').siblings('dd.current-xmpp-contact').find('a.open-chat'); for (i=0; i