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.drawer = this.root_.querySelector(
MDCTemporaryDrawerFoundation.strings.DRAWER_SELECTOR
)
const {
FOCUSABLE_ELEMENTS,
OPACITY_VAR_NAME,
} = MDCTemporaryDrawerFoundation.strings
// prettier-ignore
return new MDCTemporaryDrawerFoundation({
addClass: helper.addClass('rootProps', this),
removeClass: helper.removeClass('rootProps', this),
hasClass: helper.hasClass('rootProps', this),
addBodyClass: helper.addClass(document.body),
removeBodyClass: helper.removeClass(document.body),
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('drawerProps', this, 'transitionend'),
deregisterTransitionEndHandler: helper.deregisterHandler('drawerProps', this, 'transitionend'),
constructor(props) {
super(props);
this.adapter = new FoundationAdapter();
this.foundation = new MDCTemporaryDrawerFoundation(this.adapter.toObject());
}
constructor (props: Props<p>) {
super(props);
this.adapter = new FoundationAdapter(this);
this.foundation = new MDCTemporaryDrawerFoundation(this.adapter.toObject());
}
</p>