0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-13 22:41:32 -05:00
ghost/core/client/app/components/gh-dropdown-button.js

20 lines
540 B
JavaScript
Raw Normal View History

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