Skip to content

Instantly share code, notes, and snippets.

@zulfajuniadi
Last active December 19, 2015 20:09
Show Gist options
  • Save zulfajuniadi/6011332 to your computer and use it in GitHub Desktop.
Save zulfajuniadi/6011332 to your computer and use it in GitHub Desktop.
Deps.autorun(function(){
Template.modal.html = function(){
return Template['modal' + Session.get('modalName')]();
}
})
showModal = function(templateName) {
Session.set('modalName', templateName);
setTimeout(function(){
$('#modal').modal('show');
setTimeout(function(){
$('.chosen').chosen();
},500)
},100)
}
closeModal = function() {
var m = $('#modal');
$('form', m)[0].reset();
m.modal('hide');
}
/*
// Client JS
Session.set('modalName', 'Project');
// HTML
<template name="modal">
<div class="modal hide fade" id="modal">
{{{html}}}
</div>
</template>
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment