How to use the @material/menu.MDCMenu function in @material/menu

To help you get started, we’ve selected a few @material/menu examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github rx / presenters / views / mdc / assets / js / components / menus.js View on Github external
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();
    }
github trimox / angular-mdc-web / src / lib / select / select.ts View on Github external
ngAfterViewInit(): void {
    this._menuFactory = new MDCMenu(this.selectMenu.elementRef.nativeElement);
    this._foundation.init();

    if (this.autosize) {
      this._setWidth();
    }
  }
github prateekbh / preact-material-components / packages / menu / src / index.tsx View on Github external
public componentDidMount() {
    super.componentDidMount();
    if (this.control) {
      this.MDComponent = new MDCMenu(this.control);
      this.MDComponent.listen('MDCMenu:selected', this.onSelect);
    }
  }
github fintechstudios / angularjs-mdc / src / mdc-select / select / component.js View on Github external
  initialize(menuFactory = (el) => new MDCMenu(el), labelFactory = (el) => new MDCSelectLabel(el)) {
    this.surface_ = this.root_.querySelector(MDCSelectFoundation.strings.SURFACE_SELECTOR);
github prateekbh / preact-material-components / ts / Menu / index.tsx View on Github external
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();
  }
github prateekbh / preact-material-components / ts / Menu / index.tsx View on Github external
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();
  }
github TEIC / romajs / src / components / Header.js View on Github external
componentDidMount() {
    this.lang = new MDCMenu(this.refs.lang)
  }
github TEIC / romajs / src / components / DownloadButton.js View on Github external
componentDidMount() {
    this.menu = new MDCMenu(this.refs.menu)
  }