Commit 1b3ee2905a0cb00a98265dfd85dc66f2e87d675b
html-element: add note about optimising replace
Matt McKegg committed on 7/21/2016, 4:11:48 AMParent: be0df157d2e308a5ea7014d2d266d2d48f87699d
Files changed
html-element.js | changed |
html-element.js | ||
---|---|---|
@@ -85,8 +85,9 @@ | ||
85 | 85 … | }) |
86 | 86 … | } |
87 | 87 … | |
88 | 88 … | function replace (oldNodes, newNodes) { |
89 … | + // TODO: optmize to not reinsert nodes that are already in correct position! | |
89 | 90 … | var parent = oldNodes[oldNodes.length - 1].parentNode |
90 | 91 … | var marker = oldNodes[oldNodes.length - 1].nextSibling |
91 | 92 … | oldNodes.filter(function (node) { |
92 | 93 … | return !~newNodes.indexOf(node) |
Built with git-ssb-web