Drew Walters created CB-840:
-------------------------------

             Summary: deviceready event listener not notified if previously 
fired
                 Key: CB-840
                 URL: https://issues.apache.org/jira/browse/CB-840
             Project: Apache Cordova
          Issue Type: Bug
          Components: CordovaJS
    Affects Versions: 1.8.0
            Reporter: Drew Walters
            Assignee: Drew Walters
             Fix For: 1.8.0


The fix for [CB-683] has broken previous behavior of the 'deviceready' event. 
Prior to CB-683, registering an event listener for the 'deviceready' event 
after the event had already fired would result in the specified handler 
immediately being fired.

The difference is due to channel.subscribe instead of channel.subscribeOnce 
being used. A simple fix is to add back the invocation of subscribeOnce if the 
event is 'deviceready':

    if (typeof documentEventHandlers[e] != 'undefined') {
        if (evt === 'deviceready') {
            documentEventHandlers[e].subscribeOnce(handler);
        } else {
            documentEventHandlers[e].subscribe(handler);
        }
    } else {

--
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

        

Reply via email to