mirror of
https://github.com/flarum/framework.git
synced 2025-06-01 04:56:58 +08:00
Move forum ember app into a subdir, preparing for admin app to exist alongside
This commit is contained in:
31
ember/forum/app/components/ui/dropdown-button.js
Normal file
31
ember/forum/app/components/ui/dropdown-button.js
Normal file
@ -0,0 +1,31 @@
|
||||
import Ember from 'ember';
|
||||
|
||||
/**
|
||||
Button which has an attached dropdown menu containing an item list.
|
||||
*/
|
||||
export default Ember.Component.extend({
|
||||
layoutName: 'components/ui/dropdown-button',
|
||||
classNames: ['dropdown', 'btn-group'],
|
||||
classNameBindings: ['itemCountClass', 'class'],
|
||||
|
||||
label: 'Controls',
|
||||
icon: 'ellipsis-v',
|
||||
buttonClass: 'btn btn-default',
|
||||
menuClass: '',
|
||||
items: null,
|
||||
|
||||
dropdownMenuClass: Ember.computed('menuClass', function() {
|
||||
return 'dropdown-menu '+this.get('menuClass');
|
||||
}),
|
||||
|
||||
itemCountClass: Ember.computed('items.length', function() {
|
||||
var count = this.get('items.length');
|
||||
return count ? 'item-count-'+this.get('items.length') : '';
|
||||
}),
|
||||
|
||||
actions: {
|
||||
buttonClick: function() {
|
||||
this.sendAction('buttonClick');
|
||||
}
|
||||
}
|
||||
});
|
Reference in New Issue
Block a user