Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
mounted() {
const strings = MDCDialogFoundation.strings;
const { open, autoStackButtons, escapeKeyAction, scrimClickAction } = this;
this.buttons_ = [].slice.call(this.$el.querySelectorAll(cssClasses.BUTTON));
this.defaultButton = this.$el.querySelector(
`[${strings.BUTTON_DEFAULT_ATTRIBUTE}]`,
);
const adapter = {
addClass: className => this.$set(this.classes, className, true),
removeClass: className => this.$delete(this.classes, className),
hasClass: className => this.$el.classList.contains(className),
addBodyClass: className => document.body.classList.add(className),
removeBodyClass: className => document.body.classList.remove(className),
eventTargetMatches: (target, selector) => matches(target, selector),
trapFocus: initialFocusEl => this.focusTrap && this.focusTrap.activate(),
getInitialFocusEl_() {
return document.querySelector(
`[${MDCDialogFoundation.strings.INITIAL_FOCUS_ATTRIBUTE}]`,
);
},
onOpen_(value) {
mounted() {
const strings = MDCDialogFoundation.strings;
const { open, autoStackButtons, escapeKeyAction, scrimClickAction } = this;
this.buttons_ = [].slice.call(this.$el.querySelectorAll(cssClasses.BUTTON));
this.defaultButton = this.$el.querySelector(
`.${cssClasses.DEFAULT_BUTTON}`,
);
const adapter = {
addClass: className => this.$set(this.classes, className, true),
removeClass: className => this.$delete(this.classes, className),
hasClass: className => this.$el.classList.contains(className),
addBodyClass: className => document.body.classList.add(className),
removeBodyClass: className => document.body.classList.remove(className),
eventTargetMatches: (target, selector) => matches(target, selector),
trapFocus: () => this.focusTrap && this.focusTrap.activate(),