Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Commit

Permalink
Refine timing related to calling Polymer() in main document scripts w…
Browse files Browse the repository at this point in the history
…hen polymer is imported.
  • Loading branch information
sorvell committed Dec 18, 2013
1 parent cb58f30 commit f3eb922
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/declaration/polymer-element.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,16 @@
// make window.Polymer reference `element()`
window.Polymer = element;

// Under the HTMLImports polyfill, scripts in the main document
// do not block on imports; we want to allow calls to Polymer in the main
// document. We do so via coordination with Platform:
var declarations = Platform.deliverDeclarations();
if (declarations) {
for (var i=0, l=declarations.length, d; (i<l) && (d=declarations[i]); i++) {
element.apply(null, d);
}
}

// register polymer-element with document
document.register('polymer-element', {prototype: prototype});
})(Polymer);

0 comments on commit f3eb922

Please sign in to comment.