Browse Source

Squashed commit of the following:

commit 494adcbf08accd3528f9686c29dd592617243bd3
Author: Eric McDaniel <eric.g.mcdaniel@gmail.com>
Date:   Wed Mar 5 10:54:32 2014 -0500

    Changed '==' to '==='

commit 5eefe9b4a21de7b05a9832d1ccc06a05d16cdb5e
Author: Eric McDaniel <eric.g.mcdaniel@gmail.com>
Date:   Wed Mar 5 10:50:53 2014 -0500

    Changed options declaration

commit b3d8980e782e685c1b8a930d56a99b57e6af189d
Author: Eric McDaniel <eric.g.mcdaniel@gmail.com>
Date:   Wed Mar 5 10:47:09 2014 -0500

    Fixed variable declarations

commit 037791268d5eacb766573e29a05c52b191b4bfba
Author: Eric McDaniel <eric.g.mcdaniel@gmail.com>
Date:   Wed Mar 5 10:43:11 2014 -0500

    Update push.js

commit ee7681ed11cab9ca956eae7a44744bd34b736a1f
Author: Eric McDaniel <eric.g.mcdaniel@gmail.com>
Date:   Wed Mar 5 10:39:13 2014 -0500

    Support for CustomEvent on older devices.

    Samsung Galaxy SII did not pass typeof CustomEvent == 'function' in a PhoneGap application. This broke Push and my app. This fix should be applied for all CustomEvents in Ratchet in order to work on older devices.
pull/426/head
MFTCMBP2 11 years ago
parent
commit
1a4367f64d
  1. 18
      js/push.js

18
js/push.js

@ -382,11 +382,19 @@
};
var triggerStateChange = function () {
var e = new CustomEvent('push', {
detail: { state: getCached(PUSH.id) },
bubbles: true,
cancelable: true
});
var e;
var options = {};
options.detail = { state: getCached(PUSH.id) };
options.bubbles = true;
options.cancelable = true;
if (typeof CustomEvent === 'function') {
e = new CustomEvent('push', options);
} else if (document.createEvent) {
e = document.createEvent('CustomEvent');
e.initCustomEvent('push', options.bubbles, options.cancelable, options.detail);
}
window.dispatchEvent(e);
};

Loading…
Cancel
Save