sbrajesh / bp-chat

Facebook Like chat Plugin for BuddyPress
http://buddydev.com/plugins/bp-chat/
22 stars 15 forks source link

Chat users window js refresh bugfix #8

Open eggp opened 11 years ago

eggp commented 11 years ago

Hello! I modify ChatSettings.update_online_count method

update_online_count: function(){ var oc=jQuery("div#chat_buddylist").find("span.online_count").get(0); var lastCount = parseInt(jQuery(oc).html());

jQuery.post(ajaxurl, {
                        action: 'bpchat_get_online_users_count',
                        'cookie': encodeURIComponent(document.cookie)
                        },
                  function(ret){
                      if(parseInt(ret) != lastCount)
                      {
                        jQuery(oc).html(ret);
                        ChatSettings.update_online_list();
                      }
            })//end of post
},