Return-Path: X-Original-To: apmail-incubator-callback-dev-archive@minotaur.apache.org Delivered-To: apmail-incubator-callback-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9762B9AA3 for ; Mon, 6 Feb 2012 21:11:21 +0000 (UTC) Received: (qmail 4797 invoked by uid 500); 6 Feb 2012 21:11:21 -0000 Delivered-To: apmail-incubator-callback-dev-archive@incubator.apache.org Received: (qmail 4508 invoked by uid 500); 6 Feb 2012 21:11:20 -0000 Mailing-List: contact callback-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: callback-dev@incubator.apache.org Delivered-To: mailing list callback-dev@incubator.apache.org Received: (qmail 4492 invoked by uid 99); 6 Feb 2012 21:11:20 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Feb 2012 21:11:20 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Feb 2012 21:11:19 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 45BB4CCBAD for ; Mon, 6 Feb 2012 21:10:59 +0000 (UTC) Date: Mon, 6 Feb 2012 21:10:59 +0000 (UTC) From: "Shazron Abdullah (Commented) (JIRA)" To: callback-dev@incubator.apache.org Message-ID: <1543906608.3670.1328562659287.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <660416173.19409.1322513260137.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (CB-44) "resume" event fires when "pause" is triggered MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CB-44?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13201586#comment-13201586 ] 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 run. 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: https://issues.apache.org/jira/browse/CB-44 > Project: Apache Callback > Issue Type: Bug > Components: iOS > Reporter: Shazron Abdullah > > reported at: https://github.com/phonegap/phonegap-iphone/issues/314 > by: https://github.com/tifroz > 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: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira