driftyco/ionic — pull request #2230 by chaffeqa (2014-09-16 23:11:22+00:00)
Title: Correctly handle window loaded states

Previously if this script was executed after the window was loaded, none of the callbacks would fire.

See https://developer.mozilla.org/en-US/docs/Web/API/document.readyState for definition of detecting the `load` event.

TODO: Potentially this is redundent, since maybe using `ionic.DomUtil.ready` would mean one less listener. However I don't know if the listeners attached to `ionic.Platform.ready` require the `document.readyState` to be `complete` rather than only `interactive`.

Linked to #2229