2016-06-30 20:14:25 +02:00
|
|
|
import Component from 'ember-component';
|
|
|
|
import injectService from 'ember-service/inject';
|
2016-05-24 14:06:59 +02:00
|
|
|
import DropdownMixin from 'ghost-admin/mixins/dropdown-mixin';
|
2014-09-28 17:39:25 +02:00
|
|
|
|
2015-10-28 12:36:45 +01:00
|
|
|
export default Component.extend(DropdownMixin, {
|
2014-09-28 17:39:25 +02:00
|
|
|
tagName: 'button',
|
2015-03-07 21:35:45 +01:00
|
|
|
attributeBindings: 'role',
|
|
|
|
role: 'button',
|
2014-10-24 23:09:50 +02:00
|
|
|
|
|
|
|
// matches with the dropdown this button toggles
|
2014-09-28 17:39:25 +02:00
|
|
|
dropdownName: null,
|
2014-10-24 23:09:50 +02:00
|
|
|
|
2016-06-30 20:14:25 +02:00
|
|
|
dropdown: injectService(),
|
2015-05-26 04:10:50 +02:00
|
|
|
|
2014-10-24 23:09:50 +02:00
|
|
|
// Notify dropdown service this dropdown should be toggled
|
2015-10-28 12:36:45 +01:00
|
|
|
click(event) {
|
2014-09-28 17:39:25 +02:00
|
|
|
this._super(event);
|
|
|
|
this.get('dropdown').toggleDropdown(this.get('dropdownName'), this);
|
|
|
|
}
|
|
|
|
});
|