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

Commit

Permalink
remove imports from html so we don't have to manage them.
Browse files Browse the repository at this point in the history
  • Loading branch information
sorvell committed Apr 3, 2014
1 parent bfd0a0a commit 796dd65
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions x-designable.html
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,7 @@
var template = document.createElement('template');
template.bindingDelegate = this.syntax;
template.innerHTML = html;
this.sanitizeContent(template.content);
this.innerHTML = '';
// make imports go...
this.loadElementImports(template.content, function() {
Expand All @@ -340,6 +341,13 @@
this.notify();
}.bind(this));
},
sanitizeContent: function(element) {
// remove imports so that we don't have to keep track of them
var imports = element.querySelectorAll('link[rel=import]').array();
imports.forEach(function(i) {
i.remove();
});
},
loadElementImports: function(element, callback) {
var pending = 1;
var receive = function() {
Expand Down

0 comments on commit 796dd65

Please sign in to comment.