onPause Callback Not Triggered in me.state.pause
HI
Currently the onPause callback is defined in the EventListener "blur":
// set pause action on losing focus $.addEventListener("blur", function() { // only in case we are not loading stuff if (me.sys.pauseOnBlur && (_state != obj.LOADING)) { obj.pause(true); } // callback? if (obj.onPause) obj.onPause(); ...
But the same is not in the pause function:
obj.pause = function(music) { // stop the main loop _stopRunLoop(); // current music stop if (music) me.audio.pauseTrack(); };
The right would move the function callback from EventListener to obj.pause? The same logic is valid for the "resume" function.
Thanks!
Hmm, doesn't it seem kind of silly to expect your callback to fire when your code calls me.state.pause? Your code can also fire the callback at the same time.
I agree with parasyte, since you are directly calling the me.state.pause() function, you can also call any other function :)