From dd432549597337d1c00a4c912891a1d5a0262aa2 Mon Sep 17 00:00:00 2001 From: alan bount Date: Tue, 26 Jan 2016 14:04:09 -0500 Subject: [PATCH 1/8] change to handlebars comment, so not rendered to DOM --- lib/reactive-modal.html | 2 +- package.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/reactive-modal.html b/lib/reactive-modal.html index 7c41839..e21f7af 100644 --- a/lib/reactive-modal.html +++ b/lib/reactive-modal.html @@ -7,7 +7,7 @@ From 132f410634c29eb9144ee755029d4d1e1027d3df Mon Sep 17 00:00:00 2001 From: alan bount Date: Tue, 26 Jan 2016 14:40:31 -0500 Subject: [PATCH 5/8] support for strings as info.template, lookup Template --- lib/reactive-modal.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/reactive-modal.js b/lib/reactive-modal.js index 294115d..caa35a6 100644 --- a/lib/reactive-modal.js +++ b/lib/reactive-modal.js @@ -59,6 +59,9 @@ ReactiveModal.initDialog = function (info) { newButton.disabled.set(false); }; } + if (typeof info.template === 'string') { + info.template = Template[info.template]; + } Blaze.renderWithData(Template._reactiveModal, info, document.body); } From 8a9411c431f52546dee1b8a2b0016a7d75e31bb5 Mon Sep 17 00:00:00 2001 From: alan bount Date: Wed, 27 Jan 2016 00:32:06 -0500 Subject: [PATCH 6/8] additional params for easier event callbacks on modal --- lib/reactive-modal.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/reactive-modal.js b/lib/reactive-modal.js index caa35a6..155b406 100644 --- a/lib/reactive-modal.js +++ b/lib/reactive-modal.js @@ -74,6 +74,18 @@ ReactiveModal.initDialog = function (info) { modalTarget.modal('hide'); }; + if (info.onShow) { + modalTarget.on('show.bs.modal', info.onShow); + } + if (info.onShown) { + modalTarget.on('shown.bs.modal', info.onShown); + } + if (info.onHide) { + modalTarget.on('hide.bs.modal', info.onHide); + } + if (info.onHidden) { + modalTarget.on('hidden.bs.modal', info.onHidden); + } if (info.removeOnHide) { modalTarget.on('hidden.bs.modal', function() { $(this).remove(); From 6d73906904218426b7bb620b5ee80f18530e07e7 Mon Sep 17 00:00:00 2001 From: alan bount Date: Fri, 18 Mar 2016 11:42:21 -0400 Subject: [PATCH 7/8] add modalContainerClass --- README.md | 3 ++- lib/reactive-modal.html | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index fefb506..92f0caf 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,8 @@ Meteor.startup(function(){ var shareDialogInfo = { template: Template.appShareDialog, title: "Share the app", - modalDialogClass: "share-modal-dialog", //optional + modalContainerClass: "share-modal", //optional + modalDialogClass: "share-modal-dialog modal-lg", //optional modalBodyClass: "share-modal-body", //optional modalFooterClass: "share-modal-footer",//optional removeOnHide: true, //optional. If this is true, modal will be removed from DOM upon hiding diff --git a/lib/reactive-modal.html b/lib/reactive-modal.html index 96e7948..7bbc74f 100644 --- a/lib/reactive-modal.html +++ b/lib/reactive-modal.html @@ -1,5 +1,5 @@