davebalmer / jo

Jo (0.5.0) is a thin (~16K) candy shell for making HTML5 apps. Jo works with: PhoneGap, Chrome, Safari, Opera, FireFox, iOS, Android, BlackBerry 10, Tizen, & Windows Phone 8+. Features include skinnable UI widgets, a clean event model and a light data layer.
MIT License
1.2k stars 180 forks source link

deactivate/reactivate when joCard isn't top card in stack #34

Open incidentist opened 13 years ago

incidentist commented 13 years ago

Right now, joCard.activate() is only called when a card is first pushed onto a stack, and deactivate() is only called when it's popped. I'd prefer for deactivate() to be called when another card is pushed on top of it, and then activated again when it becomes the top card again. Alternately, there could be new event types that get fired when a card isn't on top anymore. I'm thinking of the difference between deactivate() and cleanup() in webOS.

(I'm basically constructing my Jo app in a webOSish way, where cards stay on the stack, but should have a deactivate() method that is called so that the card can stop any polling or animations that they do while active. I can think of a few workarounds, but they tend to break the stack metaphor and none of them are particularly elegant.)

davebalmer commented 13 years ago

Definitely on the list of requested changes. :) Thinking about the deactivate()/cleanup() idea.