From 664225f6fd6e00f810cc26c45f0e1c28da9aeb4f Mon Sep 17 00:00:00 2001 From: Jermolene Date: Tue, 25 Oct 2016 15:34:20 +0100 Subject: [PATCH 1/2] Ensure list widget item title is used in getStateQualifier Resolves a longstanding problem where the same state qualifier is generated for every member of a list. Fixes #2628 --- core/modules/widgets/list.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/modules/widgets/list.js b/core/modules/widgets/list.js index f4981df33..21577774c 100755 --- a/core/modules/widgets/list.js +++ b/core/modules/widgets/list.js @@ -305,6 +305,8 @@ Compute the internal state of the widget ListItemWidget.prototype.execute = function() { // Set the current list item title this.setVariable(this.parseTreeNode.variableName,this.parseTreeNode.itemTitle); + // Make sure the item title is used by widget.getStateQualifier() + this.setVariable("transclusion","{" + this.parseTreeNode.itemTitle + "}"); // Construct the child widgets this.makeChildWidgets(); }; From 56640b90bb06856748dcf9109b792942da03a663 Mon Sep 17 00:00:00 2001 From: Jermolene Date: Tue, 25 Oct 2016 22:30:02 +0100 Subject: [PATCH 2/2] Fix issue with tabs macro introduced by fix for #2628 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I’m fixing this now to show how the tabs macro can be changed to accommodate the change, but we may yet decide to reverse out the change in order to maintain backwards compatibility. One problem with changes like this is that there’s no easy way to find out where it impacts the core UI. The tabs macro is now fixed, but perhaps there’s more obscure things that are still broken in the core. If we do opt to reverse the change to preserve backwards compatibility, we could add a way to explicitly trigger the new behaviour. For example, a new attribute `updateState=“yes”`. Yet another alternative is to make completely new alternative to the list widget with revised semantics, that authors can opt-in to. For example `<$loop>`. (There was another issue we discussed a year or two ago about adding support for an index variable which may be a candidate for fixing at the same time). --- core/wiki/macros/tabs.tid | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/wiki/macros/tabs.tid b/core/wiki/macros/tabs.tid index c9d44d2e3..6a1294ecb 100644 --- a/core/wiki/macros/tabs.tid +++ b/core/wiki/macros/tabs.tid @@ -3,8 +3,9 @@ tags: $:/tags/Macro \define tabs(tabsList,default,state:"$:/state/tab",class,template)
+<$set name="state" value=<>>
-<$list filter="$tabsList$" variable="currentTab"><$set name="save-currentTiddler" value=<>><$tiddler tiddler=<>><$button set=<> setTo=<> default="$default$" selectedClass="tc-tab-selected" tooltip={{!!tooltip}}> +<$list filter="$tabsList$" variable="currentTab"><$set name="save-currentTiddler" value=<>><$tiddler tiddler=<>><$button set=<> setTo=<> default="$default$" selectedClass="tc-tab-selected" tooltip={{!!tooltip}}> <$tiddler tiddler=<>> <$set name="tv-wikilinks" value="no"> <$transclude tiddler=<> field="caption"> @@ -16,7 +17,7 @@ tags: $:/tags/Macro
<$list filter="$tabsList$" variable="currentTab"> -<$reveal type="match" state=<> text=<> default="$default$"> +<$reveal type="match" state=<> text=<> default="$default$"> <$transclude tiddler="$template$" mode="block"> @@ -28,5 +29,6 @@ tags: $:/tags/Macro
+
\end