2015-02-12 23:22:32 -05:00
|
|
|
import Ember from 'ember';
|
2014-09-28 10:39:25 -05:00
|
|
|
import DropdownMixin from 'ghost/mixins/dropdown-mixin';
|
|
|
|
|
|
|
|
var DropdownButton = Ember.Component.extend(DropdownMixin, {
|
|
|
|
tagName: 'button',
|
2015-03-07 15:35:45 -05:00
|
|
|
attributeBindings: 'role',
|
|
|
|
role: 'button',
|
2014-10-24 16:09:50 -05:00
|
|
|
|
|
|
|
// matches with the dropdown this button toggles
|
2014-09-28 10:39:25 -05:00
|
|
|
dropdownName: null,
|
2014-10-24 16:09:50 -05:00
|
|
|
|
|
|
|
// Notify dropdown service this dropdown should be toggled
|
2014-09-28 10:39:25 -05:00
|
|
|
click: function (event) {
|
|
|
|
this._super(event);
|
|
|
|
this.get('dropdown').toggleDropdown(this.get('dropdownName'), this);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2014-10-24 16:09:50 -05:00
|
|
|
export default DropdownButton;
|