FIX: Progress bar updates faster

This commit is contained in:
Robin Ward 2013-07-02 12:46:49 -04:00
parent 5770879472
commit 064efa1671
2 changed files with 6 additions and 16 deletions

View File

@ -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;

View File

@ -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() {