Mojo.Event.stageDeactivate

From WebOS101

Jump to: navigation, search

Mojo.Event.stageDeactivate - A stageDeactivate event is generated when a stage is no longer active and potentially receiving the user's attention. For card stages, this is when the stage is minimized. The event is sent to the top scene, and bubbles up to the stage's document

setup: function() {
this.minimizeHandler = this.minimized.bind(this);
this.controller.listen(this.controller.stageController.document, Mojo.Event.stageDeactivate, this.minimizeHandler);
},
 
minimized: function(event) {
// card was minimized, do your stuff!
// pause game?
 
},
cleanup: function() {
this.controller.stopListening(this.controller.stageController.document, Mojo.Event.stageDeactivate, this.minimizeHandler);
}
Personal tools