Commit e8e3038a5fca9029b33c4e23b8420bf09391ee86

Authored by Rodrigo Souto
1 parent 09647389

chat: open up most recent conversation and fix submenu toggle

public/javascripts/application.js
... ... @@ -334,8 +334,7 @@ function toggleSubmenu(trigger, title, link_list) {
334 334 }
335 335  
336 336 function toggleMenu(trigger) {
337   - hideAllSubmenus();
338   - jQuery(trigger).siblings('.simplemenu-submenu').toggle().toggleClass('opened');
  337 + jQuery(trigger).siblings('.simplemenu-submenu').toggle();
339 338 }
340 339  
341 340 function hideAllSubmenus() {
... ... @@ -569,6 +568,7 @@ function display_notice(message) {
569 568 }
570 569  
571 570 function open_chat_window(self_link, anchor) {
  571 + if(jQuery('#conversations .conversation').length == 0) jQuery('.buddies a').first().click();
572 572 if(anchor) {
573 573 jQuery('#chat').show('fast');
574 574 jQuery("#chat" ).trigger('opengroup', anchor);
... ...
public/javascripts/chat.js
... ... @@ -561,7 +561,7 @@ jQuery(function($) {
561 561 var conversation_id = Jabber.conversation_prefix + jid_id;
562 562 var conversation = $('#' + conversation_id);
563 563 if (conversation.length > 0) {
564   - return conversation;
  564 + return conversation;
565 565 }
566 566  
567 567 var jid = Jabber.jid_of(jid_id);
... ...