Fix issue with tabs macro introduced by fix for #2628

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).
This commit is contained in:
Jermolene 2016-10-25 22:30:02 +01:00
parent 664225f6fd
commit 56640b90bb
1 changed files with 4 additions and 2 deletions

View File

@ -3,8 +3,9 @@ tags: $:/tags/Macro
\define tabs(tabsList,default,state:"$:/state/tab",class,template)
<div class="tc-tab-set $class$">
<$set name="state" value=<<qualify "$state$">>>
<div class="tc-tab-buttons $class$">
<$list filter="$tabsList$" variable="currentTab"><$set name="save-currentTiddler" value=<<currentTiddler>>><$tiddler tiddler=<<currentTab>>><$button set=<<qualify "$state$">> setTo=<<currentTab>> default="$default$" selectedClass="tc-tab-selected" tooltip={{!!tooltip}}>
<$list filter="$tabsList$" variable="currentTab"><$set name="save-currentTiddler" value=<<currentTiddler>>><$tiddler tiddler=<<currentTab>>><$button set=<<state>> setTo=<<currentTab>> default="$default$" selectedClass="tc-tab-selected" tooltip={{!!tooltip}}>
<$tiddler tiddler=<<save-currentTiddler>>>
<$set name="tv-wikilinks" value="no">
<$transclude tiddler=<<currentTab>> field="caption">
@ -16,7 +17,7 @@ tags: $:/tags/Macro
<div class="tc-tab-content $class$">
<$list filter="$tabsList$" variable="currentTab">
<$reveal type="match" state=<<qualify "$state$">> text=<<currentTab>> default="$default$">
<$reveal type="match" state=<<state>> text=<<currentTab>> default="$default$">
<$transclude tiddler="$template$" mode="block">
@ -28,5 +29,6 @@ tags: $:/tags/Macro
</$list>
</div>
</$set>
</div>
\end