Fix people socketing
This commit is contained in:
parent
333e56b4d9
commit
8eea37cbdb
3 changed files with 12 additions and 10 deletions
|
|
@ -29,8 +29,8 @@ class PeopleController < ApplicationController
|
|||
format.all do
|
||||
#only do it if it is an email address
|
||||
if params[:q].try(:match, Devise.email_regexp)
|
||||
webfinger(params[:q])
|
||||
people = Person.where(:diaspora_handle => params[:q])
|
||||
webfinger(params[:q]) if people.empty?
|
||||
else
|
||||
people = Person.search(params[:q], current_user)
|
||||
end
|
||||
|
|
|
|||
|
|
@ -20,16 +20,16 @@
|
|||
= params[:q]
|
||||
|
||||
.span-15.append-1
|
||||
- if @hashes.empty?
|
||||
%p
|
||||
=t('.no_one_found')
|
||||
#people_stream.stream
|
||||
- if @hashes.empty?
|
||||
%p
|
||||
=t('.no_one_found')
|
||||
|
||||
- else
|
||||
#people_stream.stream
|
||||
- else
|
||||
- for hash in @hashes
|
||||
= render :partial => 'people/person', :locals => hash
|
||||
|
||||
= will_paginate @people
|
||||
= will_paginate @people
|
||||
|
||||
.span-8.last
|
||||
%h4
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ var WebSocketReceiver = {
|
|||
WebSocketReceiver.processLike(obj.post_id, obj.html);
|
||||
|
||||
} else {
|
||||
WebSocketReceiver.processPost(obj['class'], obj.post_id, obj.html, obj.aspect_ids);
|
||||
WebSocketReceiver.processPost(obj.html, obj.aspect_ids);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
@ -67,7 +67,9 @@ var WebSocketReceiver = {
|
|||
result_ul.siblings('.error').show();
|
||||
result_ul.find('.error').text(response.response).show();
|
||||
} else {
|
||||
$('#people_stream').prepend(response.html).slideDown('slow', function(){});
|
||||
stream = $('#people_stream');
|
||||
stream.find('p').remove();
|
||||
stream.prepend(response.html).slideDown('slow', function(){});
|
||||
var first_li = result_ul.find('li:first');
|
||||
first_li.hide();
|
||||
first_li.after(response.html);
|
||||
|
|
@ -131,7 +133,7 @@ var WebSocketReceiver = {
|
|||
$('.likes', "#" + targetGUID).first().html(html);
|
||||
},
|
||||
|
||||
processPost: function(className, postId, html, aspectIds) {
|
||||
processPost: function(html, aspectIds) {
|
||||
if(WebSocketReceiver.onPageForAspects(aspectIds)) {
|
||||
ContentUpdater.addPostToStream(html);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue