mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-23 18:17:20 +00:00
Minor optimisation to the list macro
By moving the compiling of the template outside of the main loop
This commit is contained in:
parent
bc16400ef2
commit
14e252590c
@ -61,10 +61,11 @@ exports.macro = {
|
|||||||
if(tiddlers.length === 0) {
|
if(tiddlers.length === 0) {
|
||||||
return params.emptyMessage ? encoder(params.emptyMessage) : "";
|
return params.emptyMessage ? encoder(params.emptyMessage) : "";
|
||||||
} else {
|
} else {
|
||||||
|
var fn = store.compileText(templateType,templateText,type);
|
||||||
pushTag("<ul>");
|
pushTag("<ul>");
|
||||||
for(t=0; t<tiddlers.length; t++) {
|
for(t=0; t<tiddlers.length; t++) {
|
||||||
pushTag("<li>");
|
pushTag("<li>");
|
||||||
output.push(store.renderText(templateType,templateText,type,tiddlers[t]));
|
output.push(fn(store.getTiddler(tiddlers[t]),store,utils));
|
||||||
pushTag("</li>");
|
pushTag("</li>");
|
||||||
}
|
}
|
||||||
pushTag("</ul>");
|
pushTag("</ul>");
|
||||||
|
Loading…
Reference in New Issue
Block a user