I want to manipulate the DOM based on a condition stored in story.state, however I'm having trouble finding the right point to do it.
$(document).on("ready", function() {
$('.message').show();
});
This doesn't work, presumably because the HTML is injected after the page has finished loading. The only way I can do it so far is with a set timeout.
I've also seen this,
$(document).on("showpassage:after", function() {
$('.message').show();
});
but that seems to trigger before the message div has loaded too.
Comments
But showpassage:after does fire after the passage has been displayed -- see the source code. It may be there that there's another cause why your event handler isn't firing when you expect it to.