I am looking for a way to create global bindings that will span all views within the app, so that I do not have to set up these within each view individually.
Bonus points if suggested mechanism has a way for individual input fields or views to opt out from this behaviour.
Details:
I've encountered this error where the virtual keyboard causes a div with positioned: fixed;
(the header) to be positioned oddly on the screen, and then be repositioned correctly once more when the keyboard is hidden; I have chosen to solve this using a solution similar to this:
https://stackoverflow.com/a/15537846/194982
Now, it is possible to apply this to all text input elements individually like so:
events: {
'blur input#myInputText': '_myInputTextBlur',
'focus input#myInputText': '_myInputTextFocus'
},
_myInputTextBlur: function() { console.error('_myInputTextBlur');
$('.page-header').css('display', 'block')
},
_myInputTextFocus: function() { console.error('_myInputTextFocus');
$('.page-header').css('display', 'none')
},