open-consul/ui/packages/consul-ui/app/components/popover-menu/menu-item/index.js
Ronald 6bcb98ea71
Add UI copyright headers files (#16614)
* Add copyright headers to UI files

* Ensure copywrite file ignores external libs
2023-03-14 09:18:55 -04:00

32 lines
778 B
JavaScript

/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/
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'));
},
});