Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
getDefaultFoundation() {
// prettier-ignore
return new MDCSimpleMenuFoundation({
addClass: helper.addClass('rootProps', this),
removeClass: helper.removeClass('rootProps', this),
hasClass: helper.hasClass('rootProps', this),
hasNecessaryDom: () => Boolean(this.itemsContainer_),
getAttributeForEventTarget: (target, attributeName) => target.getAttribute(attributeName),
getInnerDimensions: () => {
const {itemsContainer_: itemsContainer} = this;
return {width: itemsContainer.offsetWidth, height: itemsContainer.offsetHeight};
},
hasAnchor: () => this.root_.parentElement && this.root_.parentElement.classList.contains('mdc-menu-anchor'),
getAnchorDimensions: () => this.root_.parentElement.getBoundingClientRect(),
getWindowDimensions: () => {
return {width: window.innerWidth, height: window.innerHeight};
},
setScale: (x, y) => {
this.root_.style[util.getTransformPropertyName(window)] = `scale(${x}, ${y})`;