title now updates with switch
This commit is contained in:
parent
22cda15aa8
commit
879b3d135a
3 changed files with 7 additions and 2 deletions
|
|
@ -78,7 +78,7 @@ class PostPresenter
|
||||||
|
|
||||||
def title
|
def title
|
||||||
if post.text.present?
|
if post.text.present?
|
||||||
post.text
|
post.text(:plain_text => true)
|
||||||
else
|
else
|
||||||
I18n.translate('posts.presenter.title', :name => post.author.name)
|
I18n.translate('posts.presenter.title', :name => post.author.name)
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ class TemplatePicker
|
||||||
end
|
end
|
||||||
|
|
||||||
def note?
|
def note?
|
||||||
self.status? && post.text.length > 300
|
self.status? && post.text(:plain_text => true).length > 200
|
||||||
end
|
end
|
||||||
|
|
||||||
def rich_media?
|
def rich_media?
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@ app.pages.PostViewer = app.views.Base.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
initViews : function() {
|
initViews : function() {
|
||||||
|
/* init view */
|
||||||
this.authorView = new app.views.PostViewerAuthor({ model : this.model });
|
this.authorView = new app.views.PostViewerAuthor({ model : this.model });
|
||||||
this.interactionsView = new app.views.PostViewerInteractions({ model : this.model });
|
this.interactionsView = new app.views.PostViewerInteractions({ model : this.model });
|
||||||
this.navView = new app.views.PostViewerNav({ 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() {
|
postRenderTemplate : function() {
|
||||||
|
/* set the document title */
|
||||||
|
console.log(this.model)
|
||||||
|
document.title = this.model.get("title");
|
||||||
|
|
||||||
this.bindNavHooks();
|
this.bindNavHooks();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue