Revert "DC fix back button to profile with this.deferred reference"

This reverts commit e5206f3429.
This commit is contained in:
danielgrippi 2012-05-17 12:05:45 -07:00
parent e5206f3429
commit e48d57b19b
2 changed files with 15 additions and 20 deletions

View file

@ -59,14 +59,11 @@ app.models.Stream = Backbone.Collection.extend({
}, },
preloadOrFetch : function(){ //hai, plz test me THNX preloadOrFetch : function(){ //hai, plz test me THNX
app.hasPreload("stream") ? this.preload() : this.fetch() return $.when(app.hasPreload("stream") ? this.preload() : this.fetch())
return this.deferred
}, },
preload : function(){ preload : function(){
this.items.reset(app.parsePreload("stream")) this.items.reset(app.parsePreload("stream"))
this.trigger("fetched") this.trigger("fetched")
this.deferred = $.when(true)
} }
}); });

View file

@ -9,25 +9,23 @@ app.views.Canvas = app.views.Base.extend(_.extend({}, app.views.infiniteScrollMi
}, },
renderTemplate : function() { renderTemplate : function() {
this.stream.deferred.done(_.bind(function(){ if(this.stream.items.isEmpty()){
if(this.stream.items.isEmpty()){ var message
var message , person = app.page.model
, person = app.page.model if(person.get("is_own_profile")){
if(person.get("is_own_profile")){ message = "Make something to start the magic."
message = "Make something to start the magic."
} else {
var name = person.get("name") || ""
message = name + " hasn't posted anything yet."
}
this.$el.html("<p class='no-post-message'>" + message + "</p>")
} else { } else {
this.renderInitialPosts() var name = person.get("name") || ""
message = name + " hasn't posted anything yet."
} }
//needs to be deferred so it happens after html rendering finishes this.$el.html("<p class='no-post-message'>" + message + "</p>")
_.defer(_.bind(this.mason, this)) } else {
}, this)) this.renderInitialPosts()
}
//needs to be deferred so it happens after html rendering finishes
_.defer(_.bind(this.mason, this))
}, },
addPostView : function(post) { addPostView : function(post) {