Last active
December 19, 2015 20:09
-
-
Save zulfajuniadi/6011332 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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