diff options
| author | Igor Minar | 2011-01-09 00:57:24 -0800 |
|---|---|---|
| committer | Igor Minar | 2011-01-10 10:24:12 -0800 |
| commit | c79aba92f6b058742c9ae20a9382f6abc68afcea (patch) | |
| tree | 4aece29942b7cde621c2a31284e3723314f30d74 /src/scenario | |
| parent | 84dedb81e79a56b4c81fe413a41e7247d8fa0572 (diff) | |
| download | angular.js-c79aba92f6b058742c9ae20a9382f6abc68afcea.tar.bz2 | |
bootstrap angular on "document ready" instead of window.onload
- use jqLite api to bootstrap angular
- when jQuery is present DOMContentLoaded or hacks for IE are used
- when jqLite is present DOMContentLoaded is used for modern browsers
and IE9 and window.onload is used for other browsers.
- test html for comparing DOMContentLoaded with window.onload
Closes #224
Diffstat (limited to 'src/scenario')
| -rw-r--r-- | src/scenario/angular.prefix | 2 | ||||
| -rw-r--r-- | src/scenario/angular.suffix | 9 |
2 files changed, 4 insertions, 7 deletions
diff --git a/src/scenario/angular.prefix b/src/scenario/angular.prefix index fb9ae147..03ab29cb 100644 --- a/src/scenario/angular.prefix +++ b/src/scenario/angular.prefix @@ -21,5 +21,5 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -(function(window, document, previousOnLoad){ +(function(window, document){ var _jQuery = window.jQuery.noConflict(true); diff --git a/src/scenario/angular.suffix b/src/scenario/angular.suffix index 66843013..f3ef9f0d 100644 --- a/src/scenario/angular.suffix +++ b/src/scenario/angular.suffix @@ -1,10 +1,7 @@ var $scenario = new angular.scenario.Runner(window); - window.onload = function() { - try { - if (previousOnLoad) previousOnLoad(); - } catch(e) {} + jqLite(document).ready(function() { angularScenarioInit($scenario, angularJsConfig(document)); - }; + }); -})(window, document, window.onload); +})(window, document); |
