mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-29 15:12:58 +03:00
48e3bf003d
no issue - https://github.com/ember-cli/eslint-plugin-ember/blob/master/docs/rules/order-in-components.md - https://github.com/ember-cli/eslint-plugin-ember/blob/master/docs/rules/order-in-controllers.md - https://github.com/ember-cli/eslint-plugin-ember/blob/master/docs/rules/order-in-routes.md
25 lines
671 B
JavaScript
25 lines
671 B
JavaScript
import Component from '@ember/component';
|
|
import DropdownMixin from 'ghost-admin/mixins/dropdown-mixin';
|
|
import {inject as service} from '@ember/service';
|
|
|
|
export default Component.extend(DropdownMixin, {
|
|
dropdown: service(),
|
|
|
|
tagName: 'button',
|
|
attributeBindings: ['href', 'role'],
|
|
role: 'button',
|
|
|
|
// matches with the dropdown this button toggles
|
|
dropdownName: null,
|
|
|
|
// Notify dropdown service this dropdown should be toggled
|
|
click(event) {
|
|
this._super(event);
|
|
this.get('dropdown').toggleDropdown(this.get('dropdownName'), this);
|
|
|
|
if (this.get('tagName') === 'a') {
|
|
return false;
|
|
}
|
|
}
|
|
});
|