title now updates with switch

This commit is contained in:
Maxwell Salzberg 2012-02-27 18:40:56 -08:00
parent 22cda15aa8
commit 879b3d135a
3 changed files with 7 additions and 2 deletions

View file

@ -78,7 +78,7 @@ class PostPresenter
def title
if post.text.present?
post.text
post.text(:plain_text => true)
else
I18n.translate('posts.presenter.title', :name => post.author.name)
end

View file

@ -27,7 +27,7 @@ class TemplatePicker
end
def note?
self.status? && post.text.length > 300
self.status? && post.text(:plain_text => true).length > 200
end
def rich_media?

View file

@ -21,6 +21,7 @@ app.pages.PostViewer = app.views.Base.extend({
},
initViews : function() {
/* init view */
this.authorView = new app.views.PostViewerAuthor({ model : this.model });
this.interactionsView = new app.views.PostViewerInteractions({ model : this.model });
this.navView = new app.views.PostViewerNav({ model : this.model });
@ -47,6 +48,10 @@ app.pages.PostViewer = app.views.Base.extend({
},
postRenderTemplate : function() {
/* set the document title */
console.log(this.model)
document.title = this.model.get("title");
this.bindNavHooks();
},