diff --git a/app/views/templates/stream_element.ujs b/app/views/templates/stream_element.ujs index 48cece618..de4bd2e37 100644 --- a/app/views/templates/stream_element.ujs +++ b/app/views/templates/stream_element.ujs @@ -2,12 +2,12 @@
@@ -57,7 +57,8 @@
-
<% } %>
-
+
+
<%= public ? "Public" : "Limited" %>
-
@@ -90,8 +91,6 @@
<% } %>
-
-
Comment
diff --git a/public/javascripts/app/views/post_view.js b/public/javascripts/app/views/post_view.js
index 96844c885..a72f0a1b1 100644
--- a/public/javascripts/app/views/post_view.js
+++ b/public/javascripts/app/views/post_view.js
@@ -9,21 +9,17 @@ App.Views.Post = App.Views.StreamObject.extend({
},
render: function() {
- var self = this;
this.el = $(this.template($.extend(
this.model.toJSON(),
App.user()
)))[0];
- this.delegateEvents(); //we need this because we are explicitly setting this.el in this.render()
-
- this.$(".comments").html(new App.Views.CommentStream({
- model: this.model
- }).render().el);
-
- this.renderPostContent();
+ this.initializeTooltips()
+ .renderPostContent()
+ .renderComments();
this.$(".details time").timeago();
+ this.delegateEvents(); //we need this because we are explicitly setting this.el in this.render()
return this;
},
@@ -38,6 +34,24 @@ App.Views.Post = App.Views.StreamObject.extend({
return this;
},
+ renderComments: function(){
+ this.$(".comments").html(new App.Views.CommentStream({
+ model: this.model
+ }).render().el);
+
+ return this;
+ },
+
+ initializeTooltips: function(){
+ $([
+ this.$(".delete"),
+ this.$(".block_user"),
+ this.$(".post_scope")
+ ]).map(function() { this.twipsy(); });
+
+ return this;
+ },
+
focusCommentTextarea: function(evt){
evt.preventDefault();
this.$(".new_comment_form_wrapper").removeClass("hidden");