diff --git a/app/assets/javascripts/discourse/components/groups_list_component.js b/app/assets/javascripts/discourse/components/groups-list.js.es6 similarity index 78% rename from app/assets/javascripts/discourse/components/groups_list_component.js rename to app/assets/javascripts/discourse/components/groups-list.js.es6 index 0f78ba24f53..09ac3c3dbad 100644 --- a/app/assets/javascripts/discourse/components/groups_list_component.js +++ b/app/assets/javascripts/discourse/components/groups-list.js.es6 @@ -6,7 +6,7 @@ @namespace Discourse @module Discourse **/ -Discourse.GroupsListComponent = Em.Component.extend({ +export default Em.Component.extend({ classNames: ['groups'] }); diff --git a/app/assets/javascripts/discourse/components/navigation_item_component.js b/app/assets/javascripts/discourse/components/navigation-item.js.es6 similarity index 96% rename from app/assets/javascripts/discourse/components/navigation_item_component.js rename to app/assets/javascripts/discourse/components/navigation-item.js.es6 index e9e8f3e72c2..ff5b01acd5d 100644 --- a/app/assets/javascripts/discourse/components/navigation_item_component.js +++ b/app/assets/javascripts/discourse/components/navigation-item.js.es6 @@ -6,7 +6,7 @@ @namespace Discourse @module Discourse **/ -Discourse.NavigationItemComponent = Ember.Component.extend({ +export default Ember.Component.extend({ tagName: 'li', classNameBindings: ['active', 'content.hasIcon:has-icon'], attributeBindings: ['title'], diff --git a/app/assets/javascripts/discourse/components/notification-item.js.es6 b/app/assets/javascripts/discourse/components/notification-item.js.es6 new file mode 100644 index 00000000000..81d8629cf44 --- /dev/null +++ b/app/assets/javascripts/discourse/components/notification-item.js.es6 @@ -0,0 +1,18 @@ +export default Ember.Component.extend({ + tagName: 'li', + classNameBindings: ['notification.read'], + + _markRead: function(){ + var self = this; + this.$('a').click(function(){ + self.set('notification.read', true); + return true; + }); + }.on('didInsertElement'), + + render: function(buffer) { + var notification = this.get('notification'), + text = I18n.t(this.get('scope'), Em.getProperties(notification, 'link', 'username')); + buffer.push('' + text + ''); + } +}); diff --git a/app/assets/javascripts/discourse/components/notification_item_component.js b/app/assets/javascripts/discourse/components/notification_item_component.js deleted file mode 100644 index 238f79651bc..00000000000 --- a/app/assets/javascripts/discourse/components/notification_item_component.js +++ /dev/null @@ -1,11 +0,0 @@ -Discourse.NotificationItemComponent = Ember.Component.extend({ - tagName: 'span', - didInsertElement: function(){ - var self = this; - this.$('a').click(function(){ - self.set('model.read', true); - self.rerender(); - return true; - }); - } -}); diff --git a/app/assets/javascripts/discourse/components/keyboard_shortcuts_component.js b/app/assets/javascripts/discourse/lib/keyboard_shortcuts.js similarity index 100% rename from app/assets/javascripts/discourse/components/keyboard_shortcuts_component.js rename to app/assets/javascripts/discourse/lib/keyboard_shortcuts.js diff --git a/app/assets/javascripts/discourse/templates/components/notification-item.js.handlebars b/app/assets/javascripts/discourse/templates/components/notification-item.js.handlebars deleted file mode 100644 index 50879cae4ff..00000000000 --- a/app/assets/javascripts/discourse/templates/components/notification-item.js.handlebars +++ /dev/null @@ -1 +0,0 @@ -{{unbound boundI18n scope linkBinding="model.link" usernameBinding="model.username"}} diff --git a/app/assets/javascripts/discourse/templates/notifications.js.handlebars b/app/assets/javascripts/discourse/templates/notifications.js.handlebars index dd856989ea0..1ad8a997be0 100644 --- a/app/assets/javascripts/discourse/templates/notifications.js.handlebars +++ b/app/assets/javascripts/discourse/templates/notifications.js.handlebars @@ -3,7 +3,7 @@ {{#if content}}