Deprecation: Remove controller from templates

This commit is contained in:
Robin Ward
2016-05-09 15:15:39 -04:00
parent c7beecd8e3
commit 995c01fb58
24 changed files with 36 additions and 37 deletions
@@ -77,6 +77,8 @@ export default Ember.Controller.extend({
}
}),
topicModel: Ember.computed.alias('controllers.topic.model'),
_initializeSimilar: function() {
this.set('similarTopics', []);
}.on('init'),
@@ -252,7 +254,7 @@ export default Ember.Controller.extend({
// if we are replying to a topic AND not on the topic pop the window up
if (!force && composer.get('replyingToTopic')) {
const currentTopic = this.get('controllers.topic.model');
const currentTopic = this.get('topicModel');
if (!currentTopic || currentTopic.get('id') !== composer.get('topic.id'))
{
const message = I18n.t("composer.posting_not_on_topic");
@@ -346,7 +348,7 @@ export default Ember.Controller.extend({
});
if (this.get('controllers.application.currentRouteName').split('.')[0] === 'topic' &&
composer.get('topic.id') === this.get('controllers.topic.model.id')) {
composer.get('topic.id') === this.get('topicModel.id')) {
staged = composer.get('stagedPost');
}
@@ -61,8 +61,7 @@ export default Ember.ArrayController.extend(ModalFunctionality, {
this.perform(operation).then(topics => {
if (topics) {
topics.forEach(cb);
const refreshTarget = this.get('refreshTarget');
if (refreshTarget) { refreshTarget.send('refresh'); }
(this.get('refreshClosure') || Ember.k)();
this.send('closeModal');
}
});
@@ -70,8 +69,7 @@ export default Ember.ArrayController.extend(ModalFunctionality, {
performAndRefresh(operation) {
return this.perform(operation).then(() => {
const refreshTarget = this.get('refreshTarget');
if (refreshTarget) { refreshTarget.send('refresh'); }
(this.get('refreshClosure') || Ember.k)();
this.send('closeModal');
});
},
@@ -117,8 +115,7 @@ export default Ember.ArrayController.extend(ModalFunctionality, {
this.perform({type: 'change_category', category_id: categoryId}).then(topics => {
topics.forEach(t => t.set('category', category));
const refreshTarget = this.get('refreshTarget');
if (refreshTarget) { refreshTarget.send('refresh'); }
(this.get('refreshClosure') || Ember.k)();
this.send('closeModal');
});
},