[Git][noosfero/noosfero][master] 2 commits: chat-label-counter: display counter when buddy active but chat hidden
Rodrigo Souto
gitlab at mg.gitlab.com
Wed Feb 8 16:54:22 BRST 2017
Rodrigo Souto pushed to branch master at Noosfero / noosfero
Commits:
4dec5cb8 by Rodrigo Souto at 2017-01-23T11:01:49-03:00
chat-label-counter: display counter when buddy active but chat hidden
- - - - -
e19703d8 by Rodrigo Souto at 2017-02-08T18:54:18+00:00
Merge branch 'chat-label-counter' into 'master'
chat-label-counter: display counter when buddy active but chat hidden
See merge request !1095
- - - - -
1 changed file:
- public/javascripts/chat.js
Changes:
=====================================
public/javascripts/chat.js
=====================================
--- a/public/javascripts/chat.js
+++ b/public/javascripts/chat.js
@@ -165,7 +165,7 @@ jQuery(function($) {
if(offset == 0) history.scrollTo({top:'100%', left:'0%'});
else history.scrollTo(offset_container.height());
if (who != "self") {
- if ($(tab_id).find('.history:visible').length == 0) {
+ if ($(tab_id).find('.history:visible').length == 0 || !$('#chat').hasClass('opened')) {
count_unread_messages(jid_id);
}
document.alert_title = name;
@@ -641,6 +641,11 @@ jQuery(function($) {
if(jQuery('#conversations .conversation').length == 0) jQuery('.buddies a').first().click();
jQuery('#chat').toggleClass('opened');
jQuery('#chat-label').toggleClass('opened');
+
+ if($('#chat').hasClass('opened')) {
+ var jid_id = $('#chat-window .conversation:visible').attr('id').replace(/^conversation-/, '');
+ count_unread_messages(jid_id, true);
+ }
}
function load_conversation(jid) {
View it on GitLab: https://gitlab.com/noosfero/noosfero/compare/17cd5dd3fe461c144f5667e9e5b7cd402fba5e65...e19703d87266c44cc940479067f8cee7d0bd19de
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20170208/e330fa1a/attachment-0001.html>
More information about the Noosfero-dev
mailing list