1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2026-02-16 23:19:51 +00:00

Compare commits

...

1 Commits

Author SHA1 Message Date
Jeremy Ruston
add7f26f04 Fix passing a filtered attribute as a MVV 2026-02-16 17:58:15 +00:00
3 changed files with 22 additions and 2 deletions

View File

@@ -25,7 +25,7 @@ Render this widget into the DOM
*/
TranscludeWidget.prototype.render = function(parent,nextSibling) {
this.parentDomNode = parent;
this.computeAttributes();
this.computeAttributes({asList: true});
this.execute();
try {
this.renderChildren(parent,nextSibling);

View File

@@ -377,6 +377,7 @@ Widget.prototype.makeFakeWidgetWithVariables = function(variables) {
Compute the current values of the attributes of the widget. Returns a hashmap of the names of the attributes that have changed.
Options include:
filterFn: only include attributes where filterFn(name) returns true
asList: boolean if true returns results as an array instead of a single value
*/
Widget.prototype.computeAttributes = function(options) {
options = options || {};
@@ -389,7 +390,7 @@ Widget.prototype.computeAttributes = function(options) {
return;
}
}
var value = self.computeAttribute(attribute),
var value = self.computeAttribute(attribute,options),
multiValue = null;
if($tw.utils.isArray(value)) {
multiValue = value;

View File

@@ -0,0 +1,19 @@
title: MultiValuedVariables/TranscludeParameterDirectly
description: Multi-valued variable passed as procedure parameter via {{{filter}}} syntax
type: text/vnd.tiddlywiki-multiple
tags: [[$:/tags/wiki-test-spec]]
title: Output
\whitespace trim
\procedure showItems(itemList)
<$text text={{{ [(itemList)join[-]] }}}/>
\end
<$transclude $variable="showItems" itemList={{{ [all[tiddlers]sort[]] }}}/>
+
title: ExpectedResult
<p>$:/core-ExpectedResult-Output</p>
+