Skip to content

Instantly share code, notes, and snippets.

@jbest84
Created September 24, 2012 18:23
Show Gist options
  • Save jbest84/3777456 to your computer and use it in GitHub Desktop.
Save jbest84/3777456 to your computer and use it in GitHub Desktop.
_fillContent
_fillContent: function(/*DomNode*/ source){
// summary:
// Relocate source contents to templated container node.
// this.containerNode must be able to receive children, or exceptions will be thrown.
// tags:
// protected
var dest, frag, hasChildren;
dest = this.containerNode;
frag = document.createDocumentFragment();
hasChildren = false;
if(source && dest){
while(source.hasChildNodes()){
frag.appendChild(source.firstChild);
hasChildren = true;
}
if (hasChildren) {
dest.appendChild(frag);
}
}
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment