How to use the @material/top-app-bar.MDCTopAppBarBaseFoundation function in @material/top-app-bar

To help you get started, we’ve selected a few @material/top-app-bar 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 trimox / angular-mdc-web / packages / top-app-bar / top-app-bar.ts View on Github external
this._getHostElement().classList.remove(className);
      },
      setStyle: (property: string, value: string) => this._getHostElement().style.setProperty(property, value),
      getTopAppBarHeight: () => this._getHostElement().clientHeight,
      notifyNavigationIconClicked: () => this.navigationSelected.emit({ source: this }),
      getViewportScrollY: () => {
        if (!this._platform.isBrowser) { return 0; }

        return this._scrollTarget[this._scrollTarget === window ? 'pageYOffset' : 'scrollTop'];
      },
      getTotalActionItems: () => this.actions ? this.actions.length : 0
    };

    let foundation: MDCTopAppBarBaseFoundation;
    if (!this.elementRef) {
      return new MDCTopAppBarBaseFoundation(adapter);
    }

    if (this.short) {
      foundation = new MDCShortTopAppBarFoundation(adapter);
    } else if (this.fixed) {
      foundation = new MDCFixedTopAppBarFoundation(adapter);
    } else {
      foundation = new MDCTopAppBarFoundation(adapter);
    }
    return foundation;
  }