From 1b37a7e8e8ded3f335f17280b5b6d91a9441b2ee Mon Sep 17 00:00:00 2001 From: Manzoor Husain Date: Thu, 28 Nov 2019 14:12:14 +0530 Subject: [PATCH] fix model close --- addon/components/s-modal.js | 11 ++++++++++- addon/templates/components/s-modal.hbs | 12 ++++++------ tests/dummy/app/templates/docs/modal.md | 3 +-- 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/addon/components/s-modal.js b/addon/components/s-modal.js index e07146f..38f0aca 100644 --- a/addon/components/s-modal.js +++ b/addon/components/s-modal.js @@ -3,6 +3,15 @@ import layout from '../templates/components/s-modal'; export default Component.extend({ layout, - classNames: ['s-modal'] + classNames: ['s-modal'], + isVisible: true, + actions: { + onCancel() { + this.set('isVisible', false); + if (this.get('onCancelAction')) { + this.get('onCancelAction')(); + } + } + } }); diff --git a/addon/templates/components/s-modal.hbs b/addon/templates/components/s-modal.hbs index c2d2bdd..1515cbd 100644 --- a/addon/templates/components/s-modal.hbs +++ b/addon/templates/components/s-modal.hbs @@ -1,7 +1,9 @@ +