ES6: Most controllers converted over now.
This commit is contained in:
parent
20c640355d
commit
663c57a0f0
|
@ -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')
|
||||||
});
|
});
|
||||||
|
|
|
@ -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')
|
||||||
|
|
||||||
});
|
});
|
|
@ -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() {
|
|
@ -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'),
|
|
@ -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');
|
|
@ -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() {
|
||||||
|
|
|
@ -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>
|
||||||
|
|
Loading…
Reference in New Issue