2015-02-10 15:35:40 +08:00
|
|
|
import Ember from 'ember';
|
|
|
|
|
|
|
|
import HasItemLists from 'flarum/mixins/has-item-lists';
|
|
|
|
import DropdownButton from 'flarum/components/ui/dropdown-button';
|
|
|
|
|
|
|
|
export default DropdownButton.extend(HasItemLists, {
|
|
|
|
layoutName: 'components/application/user-dropdown',
|
|
|
|
itemLists: ['items'],
|
|
|
|
|
|
|
|
buttonClass: 'btn btn-default btn-naked btn-rounded btn-user',
|
|
|
|
menuClass: 'pull-right',
|
|
|
|
label: Ember.computed.alias('user.username'),
|
|
|
|
|
|
|
|
populateItems: function(items) {
|
2015-02-12 12:46:15 +08:00
|
|
|
var self = this;
|
2015-02-10 15:35:40 +08:00
|
|
|
this.addActionItem(items, 'profile', 'Profile', 'user');
|
|
|
|
this.addActionItem(items, 'settings', 'Settings', 'cog');
|
2015-02-12 12:46:15 +08:00
|
|
|
this.addSeparatorItem(items);
|
|
|
|
this.addActionItem(items, 'logout', 'Log Out', 'sign-out', null, function() {
|
2015-02-13 09:17:58 +08:00
|
|
|
self.get('logout')();
|
2015-02-12 12:46:15 +08:00
|
|
|
});
|
2015-02-10 15:35:40 +08:00
|
|
|
}
|
|
|
|
})
|