diff --git a/app/assets/javascripts/discourse/controllers/topic_controller.js b/app/assets/javascripts/discourse/controllers/topic_controller.js index 8dd5c64ac..1f942a618 100644 --- a/app/assets/javascripts/discourse/controllers/topic_controller.js +++ b/app/assets/javascripts/discourse/controllers/topic_controller.js @@ -15,12 +15,12 @@ Discourse.TopicController = Discourse.ObjectController.extend(Discourse.Selected editingTopic: false, jumpTopDisabled: function() { - return this.get('currentPost') === 1; - }.property('currentPost'), + return (this.get('progressPosition') === 1); + }.property('postStream.filteredPostsCount', 'progressPosition'), jumpBottomDisabled: function() { - return this.get('currentPost') === this.get('highest_post_number'); - }.property('currentPost'), + return this.get('progressPosition') === this.get('postStream.filteredPostsCount'); + }.property('postStream.filteredPostsCount', 'progressPosition'), canMergeTopic: function() { if (!this.get('details.can_move_posts')) return false; diff --git a/app/assets/javascripts/discourse/views/topic_view.js b/app/assets/javascripts/discourse/views/topic_view.js index a8293b66d..bb57d3d2c 100644 --- a/app/assets/javascripts/discourse/views/topic_view.js +++ b/app/assets/javascripts/discourse/views/topic_view.js @@ -17,7 +17,6 @@ Discourse.TopicView = Discourse.View.extend(Discourse.Scrolling, { postStream: Em.computed.alias('controller.postStream'), - // Update the progress bar using sweet animations updateBar: function() { if (!this.get('postStream.loaded')) return; @@ -28,20 +27,11 @@ Discourse.TopicView = Discourse.View.extend(Discourse.Scrolling, { var totalWidth = $topicProgress.width(); var progressWidth = ratio * totalWidth; var bg = $topicProgress.find('.bg'); - bg.stop(true, true); var currentWidth = bg.width(); - if (currentWidth === totalWidth) { - bg.width(currentWidth - 1); - } + bg.css("border-right-width", (progressWidth === totalWidth) ? "0px" : "1px") + .width(progressWidth); - if (progressWidth === totalWidth) { - bg.css("border-right-width", "0px"); - } else { - bg.css("border-right-width", "1px"); - } - - bg.width(progressWidth); }.observes('controller.progressPosition', 'postStream.filteredPostsCount', 'topic.loaded'), updateTitle: function() {