all repos — h3 @ 65b9a3aa26e0a8f1cba1ffb9b647ba94d61a5713

A tiny, extremely minimalist JavaScript microframework.

Minor updates to code comments etc.
h3rald h3rald@h3rald.com
Fri, 01 May 2020 14:49:50 +0200
commit

65b9a3aa26e0a8f1cba1ffb9b647ba94d61a5713

parent

843db90e49ee19b5491ff91ca8252570c368a84c

3 files changed, 9 insertions(+), 15 deletions(-)

jump to
M docs/example/assets/js/h3.jsdocs/example/assets/js/h3.js

@@ -414,7 +414,6 @@ found = true;

break; } } - // node not in oldvnode if (!found) { map.push(-1); }

@@ -446,19 +445,18 @@ newvnode.children.length > notFoundInNew &&

newvnode.children[notFoundInNew]; const childofOld = oldvnode.children[notFoundInNew]; if (childOfNew && childofOld && childofOld.type === childOfNew.type) { - // optimization to avoid removing nodes of the same type + // Optimization to avoid removing nodes of the same type oldvnode.children[notFoundInNew].redraw({ node: node.childNodes[notFoundInNew], vnode: newvnode.children[notFoundInNew], }); } else { - // while there are children not found in newvnode, remove them and re-check + // While there are children not found in newvnode, remove them and re-check node.removeChild(node.childNodes[notFoundInNew]); oldvnode.children.splice(notFoundInNew, 1); } } else { - //(notFoundInOld >= 0) { - // while there are children not found in oldvnode, add them and re-check + // While there are children not found in oldvnode, add them and re-check node.insertBefore( newvnode.children[notFoundInOld].render(), node.childNodes[notFoundInOld]
M docs/js/h3.jsdocs/js/h3.js

@@ -414,7 +414,6 @@ found = true;

break; } } - // node not in oldvnode if (!found) { map.push(-1); }

@@ -446,19 +445,18 @@ newvnode.children.length > notFoundInNew &&

newvnode.children[notFoundInNew]; const childofOld = oldvnode.children[notFoundInNew]; if (childOfNew && childofOld && childofOld.type === childOfNew.type) { - // optimization to avoid removing nodes of the same type + // Optimization to avoid removing nodes of the same type oldvnode.children[notFoundInNew].redraw({ node: node.childNodes[notFoundInNew], vnode: newvnode.children[notFoundInNew], }); } else { - // while there are children not found in newvnode, remove them and re-check + // While there are children not found in newvnode, remove them and re-check node.removeChild(node.childNodes[notFoundInNew]); oldvnode.children.splice(notFoundInNew, 1); } } else { - //(notFoundInOld >= 0) { - // while there are children not found in oldvnode, add them and re-check + // While there are children not found in oldvnode, add them and re-check node.insertBefore( newvnode.children[notFoundInOld].render(), node.childNodes[notFoundInOld]
M h3.jsh3.js

@@ -414,7 +414,6 @@ found = true;

break; } } - // node not in oldvnode if (!found) { map.push(-1); }

@@ -446,19 +445,18 @@ newvnode.children.length > notFoundInNew &&

newvnode.children[notFoundInNew]; const childofOld = oldvnode.children[notFoundInNew]; if (childOfNew && childofOld && childofOld.type === childOfNew.type) { - // optimization to avoid removing nodes of the same type + // Optimization to avoid removing nodes of the same type oldvnode.children[notFoundInNew].redraw({ node: node.childNodes[notFoundInNew], vnode: newvnode.children[notFoundInNew], }); } else { - // while there are children not found in newvnode, remove them and re-check + // While there are children not found in newvnode, remove them and re-check node.removeChild(node.childNodes[notFoundInNew]); oldvnode.children.splice(notFoundInNew, 1); } } else { - //(notFoundInOld >= 0) { - // while there are children not found in oldvnode, add them and re-check + // While there are children not found in oldvnode, add them and re-check node.insertBefore( newvnode.children[notFoundInOld].render(), node.childNodes[notFoundInOld]