Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
notifyOpened: () => this.$emit(strings.OPENED_EVENT, {}),
notifyClosing: action => {
this.$emit('change', false);
// console.log(action)
this.$emit(strings.CLOSING_EVENT, action ? { action } : {});
LAYOUT_EVENTS.forEach(evt =>
window.removeEventListener(evt, this.handleLayout),
);
document.removeEventListener('keydown', this.handleDocumentKeyDown);
},
notifyClosed: action => {
this.$emit(strings.CLOSED_EVENT, action ? { action } : {});
},
};
this.foundation = new MDCDialogFoundation(adapter);
this.foundation.init();
if (!autoStackButtons) {
this.foundation.setAutoStackButtons(autoStackButtons);
}
if (typeof escapeKeyAction === 'string') {
// set even if empty string
this.foundation.setEscapeKeyAction(escapeKeyAction);
}
if (typeof scrimClickAction === 'string') {
// set even if empty string
this.foundation.setScrimClickAction(scrimClickAction);
}
notifyOpened: () => this.$emit(strings.OPENED_EVENT, {}),
notifyClosing: action => {
this.$emit('change', false);
// console.log(action)
this.$emit(strings.CLOSING_EVENT, action ? { action } : {});
LAYOUT_EVENTS.forEach(evt =>
window.removeEventListener(evt, this.handleLayout),
);
document.removeEventListener('keydown', this.handleDocumentKeyDown);
},
notifyClosed: action => {
this.$emit(strings.CLOSED_EVENT, action ? { action } : {});
},
};
this.foundation = new MDCDialogFoundation(adapter);
this.foundation.init();
if (!autoStackButtons) {
this.foundation.setAutoStackButtons(autoStackButtons);
}
if (typeof escapeKeyAction === 'string') {
// set even if empty string
this.foundation.setEscapeKeyAction(escapeKeyAction);
}
if (typeof scrimClickAction === 'string') {
// set even if empty string
this.foundation.setScrimClickAction(scrimClickAction);
}
mounted () {
this.focusTrap_ = createFocusTrapInstance(this.$refs.surface, this.$refs.accept)
this.foundation = new MDCDialogFoundation({
addClass: (className) => this.$el.classList.add(className),
removeClass: (className) => this.$el.classList.remove(className),
addBodyClass: (className) => document.body.classList.add(className),
removeBodyClass: (className) => document.body.classList.remove(className),
eventTargetHasClass: (target, className) => target.classList.contains(className),
registerInteractionHandler: (evt, handler) => this.$el.addEventListener(evt, handler),
deregisterInteractionHandler: (evt, handler) => this.$el.removeEventListener(evt, handler),
registerSurfaceInteractionHandler: (evt, handler) => this.$refs.surface.addEventListener(evt, handler),
deregisterSurfaceInteractionHandler: (evt, handler) => this.$refs.surface.removeEventListener(evt, handler),
registerDocumentKeydownHandler: (handler) => document.addEventListener('keydown', handler),
deregisterDocumentKeydownHandler: (handler) => document.removeEventListener('keydown', handler),
registerTransitionEndHandler: (handler) => this.$refs.surface.addEventListener('transitionend', handler),
deregisterTransitionEndHandler: (handler) => this.$refs.surface.removeEventListener('transitionend', handler),
notifyAccept: () => this.$emit('accepted'),
notifyCancel: () => this.$emit('canceled'),
isDialog: (el) => el === this.$refs.surface,