Remove deprecations in TopicProgressController
This commit is contained in:
parent
c18bc59808
commit
1f95ef31cc
|
@ -2,6 +2,7 @@ export default Ember.ObjectController.extend({
|
||||||
needs: ['topic'],
|
needs: ['topic'],
|
||||||
progressPosition: null,
|
progressPosition: null,
|
||||||
expanded: false,
|
expanded: false,
|
||||||
|
toPostIndex: null,
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
toggleExpansion: function(opts) {
|
toggleExpansion: function(opts) {
|
||||||
|
@ -50,11 +51,11 @@ export default Ember.ObjectController.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
jumpTop: function() {
|
jumpTop: function() {
|
||||||
this.jumpTo(this.get('firstPostUrl'));
|
this.jumpTo(this.get('model.firstPostUrl'));
|
||||||
},
|
},
|
||||||
|
|
||||||
jumpBottom: function() {
|
jumpBottom: function() {
|
||||||
this.jumpTo(this.get('lastPostUrl'));
|
this.jumpTo(this.get('model.lastPostUrl'));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -83,8 +84,8 @@ export default Ember.ObjectController.extend({
|
||||||
|
|
||||||
jumpBottomDisabled: function() {
|
jumpBottomDisabled: function() {
|
||||||
return this.get('progressPosition') >= this.get('model.postStream.filteredPostsCount') ||
|
return this.get('progressPosition') >= this.get('model.postStream.filteredPostsCount') ||
|
||||||
this.get('progressPosition') >= this.get('highest_post_number');
|
this.get('progressPosition') >= this.get('model.highest_post_number');
|
||||||
}.property('model.postStream.filteredPostsCount', 'highest_post_number', 'progressPosition'),
|
}.property('model.postStream.filteredPostsCount', 'model.highest_post_number', 'progressPosition'),
|
||||||
|
|
||||||
hideProgress: function() {
|
hideProgress: function() {
|
||||||
if (!this.get('model.postStream.loaded')) return true;
|
if (!this.get('model.postStream.loaded')) return true;
|
||||||
|
@ -95,14 +96,14 @@ export default Ember.ObjectController.extend({
|
||||||
|
|
||||||
hugeNumberOfPosts: function() {
|
hugeNumberOfPosts: function() {
|
||||||
return (this.get('model.postStream.filteredPostsCount') >= Discourse.SiteSettings.short_progress_text_threshold);
|
return (this.get('model.postStream.filteredPostsCount') >= Discourse.SiteSettings.short_progress_text_threshold);
|
||||||
}.property('highest_post_number'),
|
}.property('model.highest_post_number'),
|
||||||
|
|
||||||
jumpToBottomTitle: function() {
|
jumpToBottomTitle: function() {
|
||||||
if (this.get('hugeNumberOfPosts')) {
|
if (this.get('hugeNumberOfPosts')) {
|
||||||
return I18n.t('topic.progress.jump_bottom_with_number', {post_number: this.get('highest_post_number')});
|
return I18n.t('topic.progress.jump_bottom_with_number', {post_number: this.get('model.highest_post_number')});
|
||||||
} else {
|
} else {
|
||||||
return I18n.t('topic.progress.jump_bottom');
|
return I18n.t('topic.progress.jump_bottom');
|
||||||
}
|
}
|
||||||
}.property('hugeNumberOfPosts', 'highest_post_number')
|
}.property('hugeNumberOfPosts', 'model.highest_post_number')
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -230,7 +230,7 @@ Discourse.URL = Ember.Object.createWithMixins({
|
||||||
var self = this;
|
var self = this;
|
||||||
postStream.refresh(opts).then(function() {
|
postStream.refresh(opts).then(function() {
|
||||||
topicController.setProperties({
|
topicController.setProperties({
|
||||||
currentPost: closest,
|
'model.currentPost': closest,
|
||||||
enteredAt: new Date().getTime().toString()
|
enteredAt: new Date().getTime().toString()
|
||||||
});
|
});
|
||||||
var closestPost = postStream.closestPostForPostNumber(closest),
|
var closestPost = postStream.closestPostForPostNumber(closest),
|
||||||
|
|
Loading…
Reference in New Issue