Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
initialSyncWithDOM() {
const { MODAL } = MDCDismissibleDrawerFoundation.cssClasses;
if (this.drawer_.classList.contains(MODAL)) {
const { SCRIM_SELECTOR } = MDCDismissibleDrawerFoundation.strings;
this.scrim_ = this.drawer_.parentElement.querySelector(SCRIM_SELECTOR);
this.handleScrimClick_ = () => this.foundation.handleScrimClick();
this.scrim_.addEventListener('click', this.handleScrimClick_);
this.focusTrap_ = createFocusTrapInstance(
this.drawer_,
this.focusTrapFactory_,
);
}
this.handleKeydown_ = evt => this.foundation.handleKeydown(evt);
this.handleTransitionEnd_ = evt =>
this.foundation.handleTransitionEnd(evt);
this.$el.addEventListener('keydown', this.handleKeydown_);
this.$el.addEventListener('transitionend', this.handleTransitionEnd_);
},
initialSyncWithDOM() {
const { MODAL } = MDCDismissibleDrawerFoundation.cssClasses;
if (this.drawer_.classList.contains(MODAL)) {
const { SCRIM_SELECTOR } = MDCDismissibleDrawerFoundation.strings;
this.scrim_ = this.drawer_.parentElement.querySelector(SCRIM_SELECTOR);
this.handleScrimClick_ = () => this.foundation.handleScrimClick();
this.scrim_.addEventListener('click', this.handleScrimClick_);
this.focusTrap_ = util.createFocusTrapInstance(
this.drawer_,
this.focusTrapFactory_,
);
}
this.handleKeydown_ = evt => this.foundation.handleKeydown(evt);
this.handleTransitionEnd_ = evt =>
this.foundation.handleTransitionEnd(evt);
this.$el.addEventListener('keydown', this.handleKeydown_);
this.$el.addEventListener('transitionend', this.handleTransitionEnd_);
},