is there a way to know when blaze finished iteration after session update?
I get some info from an external session and store that array into a session var.
In the HTML I have a for each, after that loop is finished, I have to init another javascript library (impress.js)
thanks!
<template name="ppt_integration">
<div id="impress">
{{#each mainTopics }}
<!-- {{level 1}} - {{level 2}}
--> <div class="z step slide" data-x="{{XValue @index}}" data-y="-1500">
<h2 class="ui dividing header" style="margin-left: 160px">{{level 1}} - {{level 2}}
</h2>
<div class="ui list" style="margin-left: 175px">
{{#each item in itemsOfLevel 3}}
<div class="item">
<h3>{{{item}}}</h3>
</div>
{{/each}}
</div>
</div>
{{/each}}
</div>
</template>
js
Template.ppt_integration.onRendered(function() {
Meteor.setTimeout(function() { impress().init(); }, 1000);
// Tracker.autorun(function() {
// var topics = Session.get('integrationTopics');
// if (topics) {
// console.log('impress initialized, topics');
// Meteor.setTimeout(function() { impress().init(); }, 0);
// } else {
// console.log('wait to init impress, topics not yet loaded');
// }
// })
you see, it works when I put a delay, but if my computer is slow… 1 second is still too slow, and the ui looks crappy…
Thanks!