1
0
Fork 0
mirror of https://github.com/TryGhost/Ghost-Admin.git synced 2023-12-14 02:33:04 +01:00
Ghost-Admin/app/components/gh-dropdown-button.js

25 lines
567 B
JavaScript
Raw Normal View History

2015-02-13 05:22:32 +01:00
import Ember from 'ember';
2014-09-28 17:39:25 +02:00
import DropdownMixin from 'ghost/mixins/dropdown-mixin';
2016-01-19 14:03:27 +01:00
const {
Component,
inject: {service}
} = Ember;
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',
// matches with the dropdown this button toggles
2014-09-28 17:39:25 +02:00
dropdownName: null,
2016-01-19 14:03:27 +01:00
dropdown: service(),
// Notify dropdown service this dropdown should be toggled
click(event) {
2014-09-28 17:39:25 +02:00
this._super(event);
this.get('dropdown').toggleDropdown(this.get('dropdownName'), this);
}
});