| OLD | NEW |
| (Empty) |
| 1 /* | |
| 2 * Copyright 2013 The Polymer Authors. All rights reserved. | |
| 3 * Use of this source code is governed by a BSD-style | |
| 4 * license that can be found in the LICENSE file. | |
| 5 */ | |
| 6 (function(){ | |
| 7 | |
| 8 // bootstrap | |
| 9 | |
| 10 // IE shim for CustomEvent | |
| 11 if (typeof window.CustomEvent !== 'function') { | |
| 12 window.CustomEvent = function(inType) { | |
| 13 var e = document.createEvent('HTMLEvents'); | |
| 14 e.initEvent(inType, true, true); | |
| 15 return e; | |
| 16 }; | |
| 17 } | |
| 18 | |
| 19 function bootstrap() { | |
| 20 // preload document resource trees | |
| 21 HTMLImports.importer.load(document, function() { | |
| 22 HTMLImports.parser.parse(document); | |
| 23 HTMLImports.readyTime = new Date().getTime(); | |
| 24 // send HTMLImportsLoaded when finished | |
| 25 document.dispatchEvent( | |
| 26 new CustomEvent('HTMLImportsLoaded', {bubbles: true}) | |
| 27 ); | |
| 28 }); | |
| 29 }; | |
| 30 | |
| 31 if (document.readyState === 'complete') { | |
| 32 bootstrap(); | |
| 33 } else { | |
| 34 window.addEventListener('DOMContentLoaded', bootstrap); | |
| 35 } | |
| 36 | |
| 37 })(); | |
| OLD | NEW |