incubator-callback-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shazron Abdullah (Commented) (JIRA)" <>
Subject [jira] [Commented] (CB-44) "resume" event fires when "pause" is triggered
Date Mon, 06 Feb 2012 21:10:59 GMT


Shazron Abdullah commented on CB-44:

In the "// Do something" for the pause event, you can't call any PhoneGap API functions (ie
console.log - these get pushed into Objective-C). Anything using those will only be executed
on the next runloop, so if you add a console log there, it would only be shown in the resume
event - so it will appear like what you just described. Any pure JavaScript calls should be

To see this in action (where it works as expected) try setting a variable on pause to a known
value, then printing it on resume.
> "resume" event fires when "pause" is triggered
> ----------------------------------------------
>                 Key: CB-44
>                 URL:
>             Project: Apache Callback
>          Issue Type: Bug
>          Components: iOS
>            Reporter: Shazron Abdullah
> reported at:
> by:
> Setting up the resume listener within the "pause" handler causes the resume event to
fire upon "pause"
> ```javascript
>   document.addEventListener("pause", function() { 
>        //Do something
>        document.addEventListener("resume", function(){
>            //The code here wil actually execute when "pause" is triggered!!!
>         },false); 
>     }, false); 
> ```

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


View raw message