From e851ba69a192110fb910d2f54cb122e75bbaf432 Mon Sep 17 00:00:00 2001 From: Hsuan Lee Date: Sun, 5 May 2019 13:38:51 +0800 Subject: [PATCH] chore(module:modal): use variable to save classname string --- components/modal/nz-modal.component.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/modal/nz-modal.component.ts b/components/modal/nz-modal.component.ts index 0275cdb30c3..9932040d713 100644 --- a/components/modal/nz-modal.component.ts +++ b/components/modal/nz-modal.component.ts @@ -49,6 +49,7 @@ import { ModalButtonOptions, ModalOptions, ModalType, OnClickCallback } from './ export const MODAL_ANIMATE_DURATION = 200; // Duration when perform animations (ms) type AnimationState = 'enter' | 'leave' | null; +export const WRAP_CLASS_NAME = 'ant-modal-wrap'; @Component({ selector: 'nz-modal', @@ -315,7 +316,7 @@ export class NzModalComponent extends NzModalRef if ( this.mask && this.maskClosable && - ($event.target as HTMLElement).classList.contains('ant-modal-wrap') && + ($event.target as HTMLElement).classList.contains(WRAP_CLASS_NAME) && this.nzVisible && !this.dialogMouseDown ) {