Compare 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
+1 -1
View File
@@ -25,7 +25,7 @@ Render this widget into the DOM
*/ */
TranscludeWidget.prototype.render = function(parent,nextSibling) { TranscludeWidget.prototype.render = function(parent,nextSibling) {
this.parentDomNode = parent; this.parentDomNode = parent;
this.computeAttributes(); this.computeAttributes({asList: true});
this.execute(); this.execute();
try { try {
this.renderChildren(parent,nextSibling); this.renderChildren(parent,nextSibling);
+2 -1
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. Compute the current values of the attributes of the widget. Returns a hashmap of the names of the attributes that have changed.
Options include: Options include:
filterFn: only include attributes where filterFn(name) returns true 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) { Widget.prototype.computeAttributes = function(options) {
options = options || {}; options = options || {};
@@ -389,7 +390,7 @@ Widget.prototype.computeAttributes = function(options) {
return; return;
} }
} }
var value = self.computeAttribute(attribute), var value = self.computeAttribute(attribute,options),
multiValue = null; multiValue = null;
if($tw.utils.isArray(value)) { if($tw.utils.isArray(value)) {
multiValue = value; multiValue = value;
@@ -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>
+