John Cowen d1c879e06c
ui: Rework popover-menu auto closing (#8340)
* ui: Move more menu subcomponents deeper down into popovermenu

* ui: Simplify aria-menu component+remove auto menu close on route change

* Add ember-string-fns

* Use new PopoverMenu sub components and fix up tests

* Fix up wrong closing let

* Remove dcs from the service show page now we have it in the navigation
2020-08-10 09:26:02 +01:00

27 lines
696 B
JavaScript

import Component from '@ember/component';
import { inject as service } from '@ember/service';
import { set } from '@ember/object';
import Slotted from 'block-slots';
export default Component.extend(Slotted, {
tagName: '',
dom: service('dom'),
init: function() {
this._super(...arguments);
this.guid = this.dom.guid(this);
},
didInsertElement: function() {
this._super(...arguments);
this.menu.addSubmenu(this.guid);
},
didDestroyElement: function() {
this._super(...arguments);
this.menu.removeSubmenu(this.guid);
},
willRender: function() {
this._super(...arguments);
set(this, 'hasConfirmation', this._isRegistered('confirmation'));
},
});