How to use the @material/drawer/dismissible/foundation.strings function in @material/drawer

To help you get started, we’ve selected a few @material/drawer 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 pgbross / vue-material-adapter / packages / mcwv-drawer / mdc-drawer.js View on Github external
initialSyncWithDOM() {
      const { MODAL } = MDCDismissibleDrawerFoundation.cssClasses;

      if (this.drawer_.classList.contains(MODAL)) {
        const { SCRIM_SELECTOR } = MDCDismissibleDrawerFoundation.strings;
        this.scrim_ = this.drawer_.parentElement.querySelector(SCRIM_SELECTOR);
        this.handleScrimClick_ = () => this.foundation.handleScrimClick();
        this.scrim_.addEventListener('click', this.handleScrimClick_);
        this.focusTrap_ = createFocusTrapInstance(
          this.drawer_,
          this.focusTrapFactory_,
        );
      }

      this.handleKeydown_ = evt => this.foundation.handleKeydown(evt);
      this.handleTransitionEnd_ = evt =>
        this.foundation.handleTransitionEnd(evt);

      this.$el.addEventListener('keydown', this.handleKeydown_);
      this.$el.addEventListener('transitionend', this.handleTransitionEnd_);
    },
github pgbross / vue-material-adapter / packages / mcwv-drawer / drawer.js View on Github external
initialSyncWithDOM() {
      const { MODAL } = MDCDismissibleDrawerFoundation.cssClasses;

      if (this.drawer_.classList.contains(MODAL)) {
        const { SCRIM_SELECTOR } = MDCDismissibleDrawerFoundation.strings;
        this.scrim_ = this.drawer_.parentElement.querySelector(SCRIM_SELECTOR);
        this.handleScrimClick_ = () => this.foundation.handleScrimClick();
        this.scrim_.addEventListener('click', this.handleScrimClick_);
        this.focusTrap_ = util.createFocusTrapInstance(
          this.drawer_,
          this.focusTrapFactory_,
        );
      }

      this.handleKeydown_ = evt => this.foundation.handleKeydown(evt);
      this.handleTransitionEnd_ = evt =>
        this.foundation.handleTransitionEnd(evt);

      this.$el.addEventListener('keydown', this.handleKeydown_);
      this.$el.addEventListener('transitionend', this.handleTransitionEnd_);
    },