posts are properly socketed on filtered streams

This commit is contained in:
danielvincent 2011-01-05 14:04:50 -08:00
parent b029475421
commit 0a07dd16b5
3 changed files with 9 additions and 9 deletions

View file

@ -4,6 +4,6 @@
= render 'shared/publisher', :aspect => aspect, :aspect_ids => aspect_ids
#main_stream.stream
#main_stream.stream{:data => {:guids => aspect_ids.join(',')}}
= render 'shared/stream', :posts => post_hashes
= will_paginate @posts

View file

@ -27,6 +27,6 @@
= render 'aspects/no_contacts_message', :aspect => @aspect, :contact_count => @aspect_contacts_count, :options => false
= render 'aspects/no_posts_message', :post_count => @post_count, :contact_count=> @aspect_contacts_count
#main_stream.stream
#main_stream.stream{:data => {:guids => @aspect.id}}
= render 'shared/stream', :posts => @post_hashes
=will_paginate @posts

View file

@ -139,20 +139,20 @@ var WebSocketReceiver = {
},
onPageForAspects: function(aspectIds) {
if(location.pathname == '/aspects' && WebSocketReceiver.onPageOne()) {
return true
}
var found = false;
var streamIds = $('#main_stream').attr('data-guids'),
found = false;
$.each(aspectIds, function(index, value) {
if(WebSocketReceiver.onPageForAspect(value)) {
if(WebSocketReceiver.onStreamForAspect(value, streamIds)) {
found = true;
return false;
};
});
return found;
},
onPageForAspect: function(aspectId) {
return (location.href.indexOf(aspectId) != -1 )
onStreamForAspect: function(aspectId, streamIds) {
return (streamIds.search(aspectId) != -1);
},
onPageOne: function() {