posts are properly socketed on filtered streams
This commit is contained in:
parent
b029475421
commit
0a07dd16b5
3 changed files with 9 additions and 9 deletions
|
|
@ -4,6 +4,6 @@
|
||||||
|
|
||||||
|
|
||||||
= render 'shared/publisher', :aspect => aspect, :aspect_ids => aspect_ids
|
= 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
|
= render 'shared/stream', :posts => post_hashes
|
||||||
= will_paginate @posts
|
= will_paginate @posts
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,6 @@
|
||||||
= render 'aspects/no_contacts_message', :aspect => @aspect, :contact_count => @aspect_contacts_count, :options => false
|
= 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
|
= 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
|
= render 'shared/stream', :posts => @post_hashes
|
||||||
=will_paginate @posts
|
=will_paginate @posts
|
||||||
|
|
|
||||||
|
|
@ -139,20 +139,20 @@ var WebSocketReceiver = {
|
||||||
},
|
},
|
||||||
|
|
||||||
onPageForAspects: function(aspectIds) {
|
onPageForAspects: function(aspectIds) {
|
||||||
if(location.pathname == '/aspects' && WebSocketReceiver.onPageOne()) {
|
var streamIds = $('#main_stream').attr('data-guids'),
|
||||||
return true
|
found = false;
|
||||||
}
|
|
||||||
var found = false;
|
|
||||||
$.each(aspectIds, function(index, value) {
|
$.each(aspectIds, function(index, value) {
|
||||||
if(WebSocketReceiver.onPageForAspect(value)) {
|
if(WebSocketReceiver.onStreamForAspect(value, streamIds)) {
|
||||||
found = true;
|
found = true;
|
||||||
|
return false;
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
return found;
|
return found;
|
||||||
},
|
},
|
||||||
|
|
||||||
onPageForAspect: function(aspectId) {
|
onStreamForAspect: function(aspectId, streamIds) {
|
||||||
return (location.href.indexOf(aspectId) != -1 )
|
return (streamIds.search(aspectId) != -1);
|
||||||
},
|
},
|
||||||
|
|
||||||
onPageOne: function() {
|
onPageOne: function() {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue