ES6: Most controllers converted over now.

This commit is contained in:
Robin Ward 2014-05-27 10:51:03 -04:00
parent 20c640355d
commit 663c57a0f0
7 changed files with 8 additions and 9 deletions

View File

@ -7,7 +7,7 @@
@module Discourse @module Discourse
**/ **/
export default Em.Controller.extend({ export default Em.Controller.extend({
needs: ['topicBulkActions'], needs: ['topic-bulk-actions'],
notificationLevelId: null, notificationLevelId: null,
@ -27,7 +27,7 @@ export default Em.Controller.extend({
actions: { actions: {
changeNotificationLevel: function() { changeNotificationLevel: function() {
this.get('controllers.topicBulkActions').performAndRefresh({ this.get('controllers.topic-bulk-actions').performAndRefresh({
type: 'change_notification_level', type: 'change_notification_level',
notification_level_id: this.get('notificationLevelId') notification_level_id: this.get('notificationLevelId')
}); });

View File

@ -6,7 +6,7 @@
@namespace Discourse @namespace Discourse
@module Discourse @module Discourse
**/ **/
Discourse.TopicAdminMenuController = Discourse.ObjectController.extend({ export default Discourse.ObjectController.extend({
menuVisible: false, menuVisible: false,
needs: ['modal'], needs: ['modal'],
@ -21,5 +21,4 @@ Discourse.TopicAdminMenuController = Discourse.ObjectController.extend({
}, },
showRecover: Em.computed.and('deleted', 'details.can_recover') showRecover: Em.computed.and('deleted', 'details.can_recover')
}); });

View File

@ -7,7 +7,7 @@
@uses Discourse.ModalFunctionality @uses Discourse.ModalFunctionality
@module Discourse @module Discourse
**/ **/
Discourse.TopicBulkActionsController = Ember.ArrayController.extend(Discourse.ModalFunctionality, { export default Ember.ArrayController.extend(Discourse.ModalFunctionality, {
needs: ['discovery/topics'], needs: ['discovery/topics'],
onShow: function() { onShow: function() {

View File

@ -6,7 +6,7 @@
@namespace Discourse @namespace Discourse
@module Discourse @module Discourse
**/ **/
Discourse.TopicListItemController = Ember.ObjectController.extend({ export default Ember.ObjectController.extend({
needs: ['discovery/topics'], needs: ['discovery/topics'],
canStar: Em.computed.alias('controllers.discovery/topics.currentUser.id'), canStar: Em.computed.alias('controllers.discovery/topics.currentUser.id'),

View File

@ -6,7 +6,7 @@
@namespace Discourse @namespace Discourse
@module Discourse @module Discourse
**/ **/
Discourse.UserController = Discourse.ObjectController.extend({ export default Discourse.ObjectController.extend({
viewingSelf: function() { viewingSelf: function() {
return this.get('content.username') === Discourse.User.currentProp('username'); return this.get('content.username') === Discourse.User.currentProp('username');

View File

@ -53,7 +53,7 @@ Discourse.DiscoveryRoute = Discourse.Route.extend(Discourse.ScrollTop, Discourse
var controllerName = w.replace('modal/', ''), var controllerName = w.replace('modal/', ''),
factory = this.container.lookupFactory('controller:' + controllerName); factory = this.container.lookupFactory('controller:' + controllerName);
this.render(w, {into: 'topicBulkActions', outlet: 'bulkOutlet', controller: factory ? controllerName : 'topicBulkActions'}); this.render(w, {into: 'topicBulkActions', outlet: 'bulkOutlet', controller: factory ? controllerName : 'topic-bulk-actions'});
}, },
showBulkActions: function() { showBulkActions: function() {

View File

@ -62,7 +62,7 @@
{{/if}} {{/if}}
<tbody> <tbody>
{{each topics itemController="topicListItem" itemViewClass="Discourse.TopicListItemView"}} {{each topics itemController="topic-list-item" itemViewClass="Discourse.TopicListItemView"}}
</tbody> </tbody>
</table> </table>