Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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;
}
getViewportScrollY: () =>
this.scrollTarget &&
(this.scrollTarget as any)[
'pageYOffset' in this.scrollTarget ? 'pageYOffset' : 'scrollTop'
],
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;
}