1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-23 10:07:19 +00:00

Reducing function calls across board (#4102)

This commit is contained in:
Cameron Fischer 2019-07-14 11:20:27 -04:00 committed by Jeremy Ruston
parent cb77f3f503
commit b67e088e55

View File

@ -385,9 +385,10 @@ Widget.prototype.previousSibling = function() {
Render the children of this widget into the DOM
*/
Widget.prototype.renderChildren = function(parent,nextSibling) {
$tw.utils.each(this.children,function(childWidget) {
childWidget.render(parent,nextSibling);
});
var children = this.children;
for(var i = 0; i < children.length; i++) {
children[i].render(parent,nextSibling);
};
};
/*
@ -455,11 +456,11 @@ Widget.prototype.refreshSelf = function() {
Refresh all the children of a widget
*/
Widget.prototype.refreshChildren = function(changedTiddlers) {
var self = this,
var children = this.children,
refreshed = false;
$tw.utils.each(this.children,function(childWidget) {
refreshed = childWidget.refresh(changedTiddlers) || refreshed;
});
for (var i = 0; i < children.length; i++) {
refreshed = children[i].refresh(changedTiddlers) || refreshed;
}
return refreshed;
};