Skip to content
This repository has been archived by the owner on Dec 29, 2022. It is now read-only.

Commit

Permalink
make sure designed element does not get queued for registration.
Browse files Browse the repository at this point in the history
  • Loading branch information
sorvell committed Jul 22, 2014
1 parent 8d1a61a commit f959b1c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions elements/design-host/design-host.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,16 @@
},

loadHtml: function(html, callback) {
var raw = document.createElement('div');
// use a template to ensure the polymer-element does not upgrade
var raw = document.createElement('template');
raw.innerHTML = html;
// remove imports
var imports = raw.querySelectorAll('link[rel=import]').array();
imports.forEach(function(i) {
i.remove();
});
// absorb polymer-element
this.polymerElement = raw.querySelector('polymer-element');
this.polymerElement = raw.content.querySelector('polymer-element');
if (!this.polymerElement) {
throw new Error('Must load a <polymer-element>');
}
Expand All @@ -86,6 +87,8 @@
// absorb template
var template = this.polymerElement.querySelector('template');
if (template) {
// ensure template is owned by document so that its contents upgrade
document.adoptNode(template);
// absorb styles, convert :host style
var style = template.content.querySelector('style');
if (style) {
Expand Down

0 comments on commit f959b1c

Please sign in to comment.