mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-22 10:21:36 +03:00
c128998d86
refs https://github.com/TryGhost/Team/issues/1219 - added `dropdown.closeDropdowns()` to the `{{movable}}` modifier when dragging starts - updated ember-power-select derived inputs to close their dropdowns when the dropdown service triggers it's `'close'` event
21 lines
549 B
JavaScript
21 lines
549 B
JavaScript
import PowerSelectTrigger from 'ember-power-select/components/power-select/trigger';
|
|
import {inject as service} from '@ember/service';
|
|
|
|
export default class Trigger extends PowerSelectTrigger {
|
|
@service dropdown;
|
|
|
|
constructor() {
|
|
super(...arguments);
|
|
this.dropdown.on('close', this, this.closeFromDropdown);
|
|
}
|
|
|
|
willDestroy() {
|
|
super.willDestroy(...arguments);
|
|
this.dropdown.off('close', this, this.closeFromDropdown);
|
|
}
|
|
|
|
closeFromDropdown() {
|
|
this.args.select.actions.close();
|
|
}
|
|
}
|