Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
constructor(element) {
super(element);
this.hoistedMenuElement = element.querySelector('.mdc-menu');
this.mdcComponent = new MDCMenu(this.hoistedMenuElement);
initEvents(this.hoistedMenuElement);
// Ensure that the menu surface closes when an item is clicked
this.hoistedMenuElement.addEventListener('click', createSurfaceClickHandler(this.mdcComponent), { capture: true });
var link = this.menulink();
if (link) {
link.addEventListener('click', createMenuHandler(this.mdcComponent, element));
}
this.mdcComponent.hoistMenuToBody();
}
ngAfterViewInit(): void {
this._menuFactory = new MDCMenu(this.selectMenu.elementRef.nativeElement);
this._foundation.init();
if (this.autosize) {
this._setWidth();
}
}
public componentDidMount() {
super.componentDidMount();
if (this.control) {
this.MDComponent = new MDCMenu(this.control);
this.MDComponent.listen('MDCMenu:selected', this.onSelect);
}
}
initialize(menuFactory = (el) => new MDCMenu(el), labelFactory = (el) => new MDCSelectLabel(el)) {
this.surface_ = this.root_.querySelector(MDCSelectFoundation.strings.SURFACE_SELECTOR);
public componentDidMount() {
super.componentDidMount();
if (this.control) {
this.MDComponent = new MDCMenu(this.control);
this.MDComponent.listen('MDCMenu:selected', this.select);
this.MDComponent.listen('MDCMenu:cancel', this.cancel);
}
this.afterComponentDidMount();
}
public componentDidMount() {
super.componentDidMount();
if (this.control) {
this.MDComponent = new MDCMenu(this.control);
this.MDComponent.listen('MDCMenu:selected', this.onSelect);
this.MDComponent.listen('MDCMenu:cancel', this.onCancel);
}
this.afterComponentDidMount();
}
componentDidMount() {
this.lang = new MDCMenu(this.refs.lang)
}
componentDidMount() {
this.menu = new MDCMenu(this.refs.menu)
}