Created
September 24, 2012 18:23
-
-
Save jbest84/3777456 to your computer and use it in GitHub Desktop.
_fillContent
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_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