diff --git a/app/assets/javascripts/discourse/models/post.js b/app/assets/javascripts/discourse/models/post.js index c2091061715..dad1348dda8 100644 --- a/app/assets/javascripts/discourse/models/post.js +++ b/app/assets/javascripts/discourse/models/post.js @@ -64,32 +64,6 @@ Discourse.Post = Discourse.Model.extend({ hasHistory: Em.computed.gt('version', 1), postElementId: Discourse.computed.fmt('post_number', 'post_%@'), - // The class for the read icon of the post. It starts with read-icon then adds 'seen' or - // 'last-read' if the post has been seen or is the highest post number seen so far respectively. - bookmarkClass: function() { - var result = 'read-icon'; - if (this.get('bookmarked')) return result + ' bookmarked'; - - var topic = this.get('topic'); - if (topic && topic.get('last_read_post_number') === this.get('post_number')) { - return result + ' last-read'; - } - - return result + (this.get('read') ? ' seen' : ' unseen'); - }.property('read', 'topic.last_read_post_number', 'bookmarked'), - - // Custom tooltips for the bookmark icons - bookmarkTooltip: function() { - if (this.get('bookmarked')) return I18n.t('bookmarks.created'); - if (!this.get('read')) return ""; - - var topic = this.get('topic'); - if (topic && topic.get('last_read_post_number') === this.get('post_number')) { - return I18n.t('bookmarks.last_read'); - } - return I18n.t('bookmarks.not_bookmarked'); - }.property('read', 'topic.last_read_post_number', 'bookmarked'), - bookmarkedChanged: function() { Discourse.ajax("/posts/" + this.get('id') + "/bookmark", { type: 'PUT', diff --git a/app/assets/javascripts/discourse/views/post_menu_view.js b/app/assets/javascripts/discourse/views/post_menu_view.js index 2bc3f9bcab4..7ff4a417ddb 100644 --- a/app/assets/javascripts/discourse/views/post_menu_view.js +++ b/app/assets/javascripts/discourse/views/post_menu_view.js @@ -16,8 +16,9 @@ Discourse.PostMenuView = Discourse.View.extend({ 'post.reply_count', 'post.showRepliesBelow', 'post.can_delete', - 'post.bookmarkClass', - 'post.bookmarkTooltip', + 'post.read', + 'post.topic.last_read_post_number', + 'post.bookmarked', 'post.shareUrl', 'post.topic.deleted_at', 'post.replies.length'), @@ -188,8 +189,25 @@ Discourse.PostMenuView = Discourse.View.extend({ renderBookmark: function(post, buffer) { if (!Discourse.User.current()) return; - buffer.push(""); },