a634d8ffc7
R=jmesserly@google.com Review URL: https://codereview.chromium.org//20414002 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25505 260f80e4-7a28-3924-810f-c04153c831b5
38 lines
909 B
JavaScript
38 lines
909 B
JavaScript
/*
|
|
* Copyright 2013 The Polymer Authors. All rights reserved.
|
|
* Use of this source code is governed by a BSD-style
|
|
* license that can be found in the LICENSE file.
|
|
*/
|
|
(function(){
|
|
|
|
// bootstrap
|
|
|
|
// IE shim for CustomEvent
|
|
if (typeof window.CustomEvent !== 'function') {
|
|
window.CustomEvent = function(inType) {
|
|
var e = document.createEvent('HTMLEvents');
|
|
e.initEvent(inType, true, true);
|
|
return e;
|
|
};
|
|
}
|
|
|
|
function bootstrap() {
|
|
// preload document resource trees
|
|
HTMLImports.importer.load(document, function() {
|
|
HTMLImports.parser.parse(document);
|
|
HTMLImports.readyTime = new Date().getTime();
|
|
// send HTMLImportsLoaded when finished
|
|
document.dispatchEvent(
|
|
new CustomEvent('HTMLImportsLoaded', {bubbles: true})
|
|
);
|
|
});
|
|
};
|
|
|
|
if (document.readyState === 'complete') {
|
|
bootstrap();
|
|
} else {
|
|
window.addEventListener('DOMContentLoaded', bootstrap);
|
|
}
|
|
|
|
})();
|