In my Meteor.startup() I have this func:
window.addEventListener('keyboardHeightWillChange', function(event) {
Session.set('keyboardHeight', event.keyboardHeight);
});
Later I want to use this Session keyboardHeight in Template.foo.events:
'focus #searchbox' (e, t) {
$('#search_results').css('height', Session.get('keyboardHeight') - bar);
}
But this event fires before keyboardHeightWillChange. How can I postpone this event to wait for keyboardHeightWillChange to fire first?