Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I have figured out a decent solution -- my Modal is it's own template and a session variable controls if it gets displayed. After it is "rendered" I trigger bootstrap's JS to "open" it.</p> <pre><code>... {{#if getSession 'isRegisterConfirmation'}} {{&gt; registerConfirm}} {{/if}} &lt;/template&gt; &lt;template name="registerConfirm"&gt; &lt;div class="modal registerConfirmModal"&gt; &lt;div class="modal-header"&gt; &lt;button type="button" class="close" data-dismiss="modal" aria-hidden="true"&gt;&amp;times;&lt;/button&gt; &lt;h3&gt;Confirm Name / Info&lt;/h3&gt; &lt;/div&gt; &lt;div class="modal-body"&gt; You are registering as ... </code></pre> <p>The tricky part was tying events between Meteor and Bootstrap.</p> <ul> <li>On Meteor render -> trigger Bootstrap Modal show</li> <li>On Bootstrap Modal hide -> clear session variable from Meteor</li> </ul> <p>This actually works out very well, here's a simplified version of what I've got going on...</p> <pre><code>Template.registerConfirm.rendered = function() { var thing = Session.get('thingToConfirm'); $('.registerConfirmModal').on('hidden', function() { Session.set('thingToConfirm', ''); Session.set('isRegisterConfirmation', false); }); $('.registerConfirmModal').on('shown', function() { $('.registerConfirmModal button.confirm').focus(); }); $('.registerConfirmModal').modal('show'); }; </code></pre> <p>Then triggering the modal is as simple as setting the session variable to true.... all the rest of the interchange is based on events.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload