fixed #992
This commit is contained in:
parent
b776bb52db
commit
100d705c2f
4 changed files with 22 additions and 3 deletions
|
|
@ -2,7 +2,7 @@
|
||||||
-# licensed under the Affero General Public License version 3 or later. See
|
-# licensed under the Affero General Public License version 3 or later. See
|
||||||
-# the COPYRIGHT file.
|
-# the COPYRIGHT file.
|
||||||
|
|
||||||
%a.conversation{:href => conversations_path(:conversation_id => conversation.id)}
|
%a.conversation{:href => conversation_path(conversation)}
|
||||||
.stream_element.conversation{:data=>{:guid=>conversation.id}, :class => ('unread' if unread_counts[conversation.id].to_i > 0)}
|
.stream_element.conversation{:data=>{:guid=>conversation.id}, :class => ('unread' if unread_counts[conversation.id].to_i > 0)}
|
||||||
= person_image_tag(conversation.author)
|
= person_image_tag(conversation.author)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,4 +2,5 @@
|
||||||
-# licensed under the Affero General Public License version 3 or later. See
|
-# licensed under the Affero General Public License version 3 or later. See
|
||||||
-# the COPYRIGHT file.
|
-# the COPYRIGHT file.
|
||||||
|
|
||||||
|
|
||||||
= render 'show', :conversation => @conversation
|
= render 'show', :conversation => @conversation
|
||||||
|
|
|
||||||
|
|
@ -8,12 +8,30 @@ $(document).ready(function(){
|
||||||
$('a.conversation').live('click', function(){
|
$('a.conversation').live('click', function(){
|
||||||
$.getScript(this.href);
|
$.getScript(this.href);
|
||||||
history.pushState(null, "", this.href);
|
history.pushState(null, "", this.href);
|
||||||
|
|
||||||
|
var conv = $(this).children('.stream_element'),
|
||||||
|
cBadge = $("#message_inbox_badge").children(".badge_count");
|
||||||
|
if(conv.hasClass('unread') ){
|
||||||
|
conv.removeClass('unread');
|
||||||
|
}
|
||||||
|
if(cBadge.html() != null) {
|
||||||
|
cBadge.html().replace(/\d+/, function(num){
|
||||||
|
num = parseInt(num);
|
||||||
|
cBadge.html(parseInt(num)-1);
|
||||||
|
if(num == 1) {
|
||||||
|
cBadge.addClass("hidden");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
$(window).bind("popstate", function(){
|
$(window).bind("popstate", function(){
|
||||||
$.getScript(location.href);
|
if (location.href.match(/conversations\/\d+/) != null) {
|
||||||
return false;
|
$.getScript(location.href);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
resize();
|
resize();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue