How to use the @material/top-app-bar.MDCTopAppBarFoundation 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
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;
  }
github jamesmfriedman / rmwc / src / top-app-bar / index.tsx View on Github external
],
      getTotalActionItems: () =>
        this.root.ref
          ? this.root.ref.querySelectorAll(
              MDCTopAppBarFoundation.strings.ACTION_ITEM_SELECTOR
            ).length
          : 0
    };

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

    return foundation;
  }