How to use the @material/toolbar/dist/mdc.toolbar.MDCToolbarFoundation.strings function in @material/toolbar

To help you get started, we’ve selected a few @material/toolbar 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 gutenye / react-mc / src / Toolbar / Toolbar.js View on Github external
getDefaultFoundation() {
    this.firstRowElement_ = this.root_.querySelector(
      MDCToolbarFoundation.strings.FIRST_ROW_SELECTOR
    )
    this.titleElement_ = this.root_.querySelector(
      MDCToolbarFoundation.strings.TITLE_SELECTOR
    )
    // fix for demo
    const window_ = this.context.window || window
    // prettier-ignore
    return new MDCToolbarFoundation({
      hasClass: helper.hasClass('rootProps', this),
      addClass: helper.addClass('rootProps', this),
      removeClass: helper.removeClass('rootProps', this),
      registerScrollHandler: (handler) => window_.addEventListener('scroll', handler, util.applyPassive()),
      deregisterScrollHandler: (handler) => window_.removeEventListener('scroll', handler, util.applyPassive()),
      registerResizeHandler: (handler) => window_.addEventListener('resize', handler),
      deregisterResizeHandler: (handler) => window_.removeEventListener('resize', handler),
      getViewportWidth: () => window_.innerWidth,
      getViewportScrollY: () => window_.pageYOffset,
      getOffsetHeight: () => this.root_.offsetHeight,
      getFirstRowElementOffsetHeight: () => this.firstRowElement_.offsetHeight,
github gutenye / react-mc / src / Toolbar / Toolbar.js View on Github external
getDefaultFoundation() {
    this.firstRowElement_ = this.root_.querySelector(
      MDCToolbarFoundation.strings.FIRST_ROW_SELECTOR
    )
    this.titleElement_ = this.root_.querySelector(
      MDCToolbarFoundation.strings.TITLE_SELECTOR
    )
    // fix for demo
    const window_ = this.context.window || window
    // prettier-ignore
    return new MDCToolbarFoundation({
      hasClass: helper.hasClass('rootProps', this),
      addClass: helper.addClass('rootProps', this),
      removeClass: helper.removeClass('rootProps', this),
      registerScrollHandler: (handler) => window_.addEventListener('scroll', handler, util.applyPassive()),
      deregisterScrollHandler: (handler) => window_.removeEventListener('scroll', handler, util.applyPassive()),
      registerResizeHandler: (handler) => window_.addEventListener('resize', handler),
      deregisterResizeHandler: (handler) => window_.removeEventListener('resize', handler),
      getViewportWidth: () => window_.innerWidth,