mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-02-10 08:00:03 +00:00
Reuse attribute objects when executing custom widgets
This commit is contained in:
parent
0163c04b7d
commit
8f69c27632
@ -440,15 +440,10 @@ Widget.prototype.makeChildWidget = function(parseTreeNode,options) {
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
$tw.utils.each(parseTreeNode.attributes,function(attr) {
|
$tw.utils.each(parseTreeNode.attributes,function(attr,name) {
|
||||||
// If the attribute starts with a dollar then add an extra dollar so that it doesn't clash with the $xxx attributes of transclude
|
// If the attribute starts with a dollar then add an extra dollar so that it doesn't clash with the $xxx attributes of transclude
|
||||||
var name = attr.name.charAt(0) === "$" ? "$" + attr.name : attr.name,
|
name = name.charAt(0) === "$" ? "$" + name : name;
|
||||||
newAttr = {
|
newParseTreeNode.attributes[name] = attr;
|
||||||
name: name,
|
|
||||||
type: attr.type,
|
|
||||||
value: attr.value
|
|
||||||
};
|
|
||||||
newParseTreeNode.attributes[name] = newAttr;
|
|
||||||
});
|
});
|
||||||
parseTreeNode = newParseTreeNode;
|
parseTreeNode = newParseTreeNode;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user