Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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,
notifyChange: () => {
this.props.onChange_()
this.props.onChange()
},
setStyle: (property, value) => this.root_.style.setProperty(property, value),