Mojo.Event - Detect Card Resize
From WebOS101
Detect card resize - When a notification such as a new sms or new caller comes in, the scene resizes. In order to catch this event we listen for the 'resize' event of this.controller.window -- Note: this appears to not work if the app is fullscreen
setup: function() {
this.resizeHandler = this.resize.bindAsEventListener(this);
this.controller.listen(this.controller.window, 'resize', this.resizeHandler, false);
},
resize: function(event) {
// this.controller.window.innerWidth/Height
if (Mojo.Environment.DeviceInfo.touchableRows < 8) {
// on the Pixi
var heightChange = (400-this.controller.window.innerHeight);
}
else {
// on the Pre
var heightChange = (480-this.controller.window.innerHeight);
}
},
cleanup: function() {
this.controller.stopListening(this.controller.window, 'resize', this.resizeHandler, false);
}