Skip to content

Commit

Permalink
fix(VEX): normalize context
Browse files Browse the repository at this point in the history
  • Loading branch information
Shlomi Assaf (shlassaf) committed Aug 30, 2016
1 parent 5e6c59e commit 97adecd
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion src/components/angular2-modal/plugins/vex/modal-context.ts
Expand Up @@ -10,7 +10,7 @@ import {

const DEFAULT_VALUES = {
className: <VEXBuiltInThemes>'default',
overlayClassName: 'vex-overlay/index',
overlayClassName: 'vex-overlay',
contentClassName: 'vex-content',
closeClassName: 'vex-close'
};
Expand All @@ -37,6 +37,27 @@ export class VEXModalContext extends ModalOpenContext {
closeClassName: string;

showCloseButton: boolean;


normalize(): void {
if (!this.className) {
this.className = DEFAULT_VALUES.className;
}

if (!this.overlayClassName) {
this.overlayClassName = DEFAULT_VALUES.overlayClassName;
}

if (!this.contentClassName) {
this.contentClassName = DEFAULT_VALUES.contentClassName;
}

if (!this.closeClassName) {
this.closeClassName = DEFAULT_VALUES.closeClassName;
}

super.normalize();
}
}

export class VEXModalContextBuilder<T extends VEXModalContext> extends ModalOpenContextBuilder<T> {
Expand Down

0 comments on commit 97adecd

Please sign in to comment.