Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
getDefaultFoundation() {
const { FOCUSABLE_ELEMENTS } = MDCPersistentDrawerFoundation.strings
this.drawer = this.root_.querySelector(
MDCPersistentDrawerFoundation.strings.DRAWER_SELECTOR
)
// prettier-ignore
return new MDCPersistentDrawerFoundation({
addClass: helper.addClass('rootProps', this),
removeClass: helper.removeClass('rootProps', this),
hasClass: helper.hasClass('rootProps', this),
hasNecessaryDom: () => Boolean(this.drawer),
registerInteractionHandler: (evt, handler) =>
this.root_.addEventListener(util.remapEvent(evt), handler, util.applyPassive()),
deregisterInteractionHandler: (evt, handler) =>
this.root_.removeEventListener(util.remapEvent(evt), handler, util.applyPassive()),
registerDrawerInteractionHandler: (evt, handler) =>
this.drawer.addEventListener(util.remapEvent(evt), handler),
deregisterDrawerInteractionHandler: (evt, handler) =>
this.drawer.removeEventListener(util.remapEvent(evt), handler),
registerTransitionEndHandler: helper.registerHandler('rootProps', this, 'transitionend'),
deregisterTransitionEndHandler: helper.deregisterHandler('rootProps', this, 'transitionend'),
registerDocumentKeydownHandler: helper.registerHandler(document, 'keydown'),
deregisterDocumentKeydownHandler: helper.deregisterHandler(document, 'keydown'),