Here is an example:
{{#if currentUser}}
<li><a class="waves-effect waves-light btn modal-trigger modal-close" href="#upload">Upload Image</a></li>
{{/if}}
Currently, I am implementing the following:
Template.MasterLayout.onRendered(function()
{
$('.modal-trigger').leanModal();
});
This implementation works when a user logs in and then refreshes the page. However, I want the function to execute as soon as the "Upload Image" button is displayed. I am looking for a way to achieve "Run this function as soon as the upload image is rendered". I know how to do this using Templates, but not with individual elements. Another approach could be to trigger the function "when the user is logged in", but ideally, there should be something like "elem.onRendered" for individual elements, right?