How to use the @material/grid-list.MDCGridListFoundation function in @material/grid-list

To help you get started, we’ve selected a few @material/grid-list 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 fintechstudios / angularjs-mdc / src / mdc-grid-list / mdc-grid-list.js View on Github external
getDefaultFoundation() {
    return new MDCGridListFoundation({
      getOffsetWidth: () => this.root_.offsetWidth,
      getNumberOfTiles: () => {
        return this.root_.querySelectorAll(MDCGridListFoundation.strings.TILE_SELECTOR).length;
      },
      getOffsetWidthForTileAtIndex: (index) => {
        return this.root_.querySelectorAll(MDCGridListFoundation.strings.TILE_SELECTOR)[index].offsetWidth;
      },
      setStyleForTilesElement: (property, value) => {
        this.root_.querySelector(MDCGridListFoundation.strings.TILES_SELECTOR).style[property] = value;
      },
      registerResizeHandler: (handler) => this.window.addEventListener('resize', handler),
      deregisterResizeHandler: (handler) => this.window.removeEventListener('resize', handler),
    });
  }