mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2026-09-19 08:10:44 +00:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
add7f26f04 |
@@ -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);
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
+19
@@ -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>
|
||||||
|
+
|
||||||
|
|
||||||
Reference in New Issue
Block a user