Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// },
// deregisterScrollHandler: handler => {
// if (this.myScrollTarget) {
// this.myScrollTarget.removeEventListener('scroll', handler);
// } else {
// window.removeEventListener('scroll', handler);
// }
// },
getViewportScrollY: () => window.pageYOffset,
getTotalActionItems: () =>
this.$refs.root.querySelectorAll(`.${cssClasses.ACTION_ITEM}`).length,
};
const { short, shortCollapsed, fixed } = this;
if (short || shortCollapsed) {
this.foundation_ = new MDCShortTopAppBarFoundation(adapter);
} else if (fixed) {
this.foundation_ = new MDCFixedTopAppBarFoundation(adapter);
} else {
this.foundation_ = new MDCTopAppBarFoundation(adapter);
}
this.navIcon_ = this.$el.querySelector(NAVIGATION_ICON_SELECTOR);
if (this.navIcon_) {
this.navIcon_.addEventListener('click', this.handleNavigationClick_);
}
this.myScrollTarget = this.scrollTarget || window;
this.foundation_.init();
},
beforeDestroy() {
deregisterScrollHandler: handler => {
if (this.myScrollTarget) {
this.myScrollTarget.removeEventListener('scroll', handler);
} else {
window.removeEventListener('scroll', handler);
}
},
getViewportScrollY: () => window.pageYOffset,
getTotalActionItems: () =>
this.$refs.root.querySelectorAll(`.${cssClasses.ACTION_ITEM}`).length,
};
const { short, shortCollapsed, fixed } = this;
if (short || shortCollapsed) {
this.foundation_ = new MDCShortTopAppBarFoundation(adapter);
} else if (fixed) {
this.foundation_ = new MDCFixedTopAppBarFoundation(adapter);
} else {
this.foundation_ = new MDCTopAppBarFoundation(adapter);
}
this.foundation_.init();
},
beforeDestroy() {