Skip to content

Instantly share code, notes, and snippets.

@jakearchibald
Created February 8, 2010 12:29
Show Gist options
  • Save jakearchibald/298099 to your computer and use it in GitHub Desktop.
Save jakearchibald/298099 to your computer and use it in GitHub Desktop.
NodeListProto.clone = function() {
// TODO: make this work with events and data
var nodes = [],
i = this.length;
while (i--) {
nodes[i] = this[i].cloneNode(true);
glow.events._copyDomListeners(this[i], nodes[i]);
glow.NodeList._copyData(this[i], nodes[i]);
}
return new glow.NodeList(nodes);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment