remove widget references on backbone stream pages; don't call time_for_stream if @backbone (the method references @stream.stream_posts)

This commit is contained in:
danielgrippi 2011-12-13 21:30:02 -08:00 committed by Dennis Collinson
parent dc82316f13
commit cd1d25dc30
8 changed files with 3 additions and 27 deletions

View file

@ -53,7 +53,7 @@ class Post < ActiveRecord::Base
# gives the last three comments on the post # gives the last three comments on the post
def last_three_comments def last_three_comments
return if self.comments_count == 0 return if self.comments_count == 0
self.comments.last(3) self.comments.includes(:author => :profile).last(3)
end end
def self.excluding_blocks(user) def self.excluding_blocks(user)

View file

@ -18,7 +18,7 @@
#gs-shim{:title => popover_with_close_html("3. #{t('.stay_updated')}"), 'data-content' => t('.stay_updated_explanation')} #gs-shim{:title => popover_with_close_html("3. #{t('.stay_updated')}"), 'data-content' => t('.stay_updated_explanation')}
#main_stream.stream{:data => {:guids => stream.aspect_ids.join(','), :time_for_scroll => time_for_scroll(stream.ajax_stream?, stream)}} #main_stream.stream{:data => {:guids => stream.aspect_ids.join(','), :time_for_scroll => (@backbone ? '' : time_for_scroll(stream.ajax_stream?, stream))}}
- if !@backbone && !stream.ajax_stream? && stream.stream_posts.length > 0 - if !@backbone && !stream.ajax_stream? && stream.stream_posts.length > 0
= render 'shared/stream', :posts => stream.stream_posts = render 'shared/stream', :posts => stream.stream_posts

View file

@ -48,11 +48,8 @@ var ContentUpdater = {
addLikesToPost: function(postGUID, html) { addLikesToPost: function(postGUID, html) {
var likesContainer = $(".likes_container:first", "#" + postGUID) var likesContainer = $(".likes_container:first", "#" + postGUID)
.fadeOut("fast")
.html(html); .html(html);
Diaspora.page.publish("likes/" + postGUID + "/updated"); Diaspora.page.publish("likes/" + postGUID + "/updated");
likesContainer.fadeIn("fast");
} }
}; };

View file

@ -2,9 +2,6 @@ Diaspora.Pages.MentionsIndex = function() {
var self = this; var self = this;
this.subscribe("page/ready", function(evt, document) { this.subscribe("page/ready", function(evt, document) {
self.aspectNavigation = self.instantiate("AspectNavigation", document.find("ul#aspect_nav")); self.aspectNavigation = self.instantiate("AspectNavigation", document.find("ul#aspect_nav"));
self.stream = self.instantiate("Stream", document.find("#aspect_stream_container"));
self.infiniteScroll = self.instantiate("InfiniteScroll");
}); });
}; };

View file

@ -3,9 +3,5 @@ Diaspora.Pages.MultisIndex = function() {
this.subscribe("page/ready", function(evt, document) { this.subscribe("page/ready", function(evt, document) {
self.aspectNavigation = self.instantiate("AspectNavigation", document.find("ul#aspect_nav")); self.aspectNavigation = self.instantiate("AspectNavigation", document.find("ul#aspect_nav"));
self.stream = self.instantiate("Stream", document.find("#aspect_stream_container"));
self.infiniteScroll = self.instantiate("InfiniteScroll");
$('.indicator').twipsy({placement:'below', live:true});
}); });
}; };

View file

@ -1,8 +1,3 @@
Diaspora.Pages.PeopleShow = function() { Diaspora.Pages.PeopleShow = function() {
var self = this; var self = this;
};
this.subscribe("page/ready", function(evt, document) {
self.stream = self.instantiate("Stream", document.find("#main_stream"));
self.infiniteScroll = self.instantiate("InfiniteScroll");
});
};

View file

@ -3,7 +3,5 @@ Diaspora.Pages.TagFollowingsIndex = function() {
this.subscribe("page/ready", function(evt, document) { this.subscribe("page/ready", function(evt, document) {
self.aspectNavigation = self.instantiate("AspectNavigation", document.find("ul#aspect_nav")); self.aspectNavigation = self.instantiate("AspectNavigation", document.find("ul#aspect_nav"));
self.stream = self.instantiate("Stream", document.find("#aspect_stream_container"));
self.infiniteScroll = self.instantiate("InfiniteScroll");
}); });
}; };

View file

@ -1,9 +1,2 @@
Diaspora.Pages.TagsShow = function() { Diaspora.Pages.TagsShow = function() {
var self = this;
this.subscribe("page/ready", function(evt, document) {
self.stream = self.instantiate("Stream", document.find("#main_stream"));
self.infiniteScroll = self.instantiate("InfiniteScroll");
self.instantiate("TimeAgo", document.find("abbr.timeago"));
});
}; };