I’m learning template-level subs now and after introducing Template.subscriptionsReady my code has broken.
I have this Jade markup:
if Template.subscriptionsReady
div.ui.dropdown Choose smth..
And I use Semantic-UI, which needs to activate the dropdown first for it to actually show some items; this used to work alright:
Template.addPost.onRendered ->
$('.ui.dropdown').dropdown()
But now it’s broken due to the changed load order:
1.Template.addPost is rendered
2.$(’.ui.dropdown’).dropdown() is called but doesn’t find div.ui.dropdown
3.subscription gets ready
4.div.ui.dropdown
is rendered but not activated
So how can wait for subscription to get ready and then manipulate DOM elements?