From 8722d8fdef2fd6da6d5ad6e02c73b25552401620 Mon Sep 17 00:00:00 2001 From: Daniel Bendel Date: Wed, 6 Apr 2016 21:48:40 +0200 Subject: [PATCH] feat(md-modal): implement dismissible option, closes #162 --- src/modal/modal-trigger.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/modal/modal-trigger.js b/src/modal/modal-trigger.js index b95fe28a..eaa838cc 100644 --- a/src/modal/modal-trigger.js +++ b/src/modal/modal-trigger.js @@ -1,11 +1,14 @@ -import { customAttribute } from 'aurelia-templating'; +import { bindable, customAttribute } from 'aurelia-templating'; import { inject } from 'aurelia-dependency-injection'; +import { getBooleanFromAttributeValue } from '../common/attributes'; import { AttributeManager } from '../common/attributeManager'; import { fireMaterializeEvent } from '../common/events'; @customAttribute('md-modal-trigger') @inject(Element) export class MdModalTrigger { + @bindable() dismissible = true; + constructor(element) { this.element = element; this.attributeManager = new AttributeManager(this.element); @@ -15,7 +18,8 @@ export class MdModalTrigger { attached() { this.attributeManager.addClasses('modal-trigger'); $(this.element).leanModal({ - complete: this.onComplete + complete: this.onComplete, + dismissible: getBooleanFromAttributeValue(this.dismissible) }); }