From 45a362c2859ed401a0af5ca3bbbc976710bf4acf Mon Sep 17 00:00:00 2001 From: Jermolene Date: Wed, 26 Mar 2014 13:06:11 +0000 Subject: [PATCH] Add a dropdown to tags in edit mode As discussed in TW Hangout 40 --- core/ui/EditTemplate/tags.tid | 23 +++++++++++++++++++---- core/ui/TagEditTemplate.tid | 16 ++++++++++++++++ 2 files changed, 35 insertions(+), 4 deletions(-) create mode 100644 core/ui/TagEditTemplate.tid diff --git a/core/ui/EditTemplate/tags.tid b/core/ui/EditTemplate/tags.tid index 80b5db043..f35efe057 100644 --- a/core/ui/EditTemplate/tags.tid +++ b/core/ui/EditTemplate/tags.tid @@ -5,10 +5,19 @@ tags: $:/tags/EditTemplate \define tag-styles() background-color:$(backgroundColor)$; \end -
<$fieldmangler><$list filter="[is[current]tags[]sort[title]]" storyview="pop"><$set name="backgroundColor" value={{!!color}}>> class="tw-tag-label"><$view field="title" format="text" /><$button message="tw-remove-tag" param={{!!title}} class="btn-invisible tw-remove-tag-button">× - +
+<$fieldmangler> +<$list filter="[is[current]tags[]sort[title]]" storyview="pop" template="$:/core/ui/TagEditTemplate"/> -
<$edit-text tiddler="$:/temp/NewTagName" tag="input" default="" placeholder={{$:/language/EditTemplate/Tags/Add/Placeholder}} focusPopup=<> class="tw-edit-texteditor"/> <$button popup=<> class="btn-invisible btn-dropdown">{{$:/core/images/down-arrow}} <$button message="tw-add-tag" param={{$:/temp/NewTagName}} set="$:/temp/NewTagName" setTo="" class=""><>
+
+ +<$edit-text tiddler="$:/temp/NewTagName" tag="input" default="" placeholder={{$:/language/EditTemplate/Tags/Add/Placeholder}} focusPopup=<> class="tw-edit-texteditor"/> + <$button popup=<> class="btn-invisible btn-dropdown">{{$:/core/images/down-arrow}} +<$button message="tw-add-tag" param={{$:/temp/NewTagName}} set="$:/temp/NewTagName" setTo="" class=""> +<> + + +
@@ -18,7 +27,13 @@ background-color:$(backgroundColor)$; <$linkcatcher set="$:/temp/NewTagName" setTo="" message="tw-add-tag"> <$list filter="[!is[shadow]tags[]search{$:/temp/NewTagName}sort[title]]"> -<$link><$set name="backgroundColor" value={{!!color}}>> class="tw-tag-label"><$view field="title" format="text"/> +<$link> +<$set name="backgroundColor" value={{!!color}}> +> class="tw-tag-label"> +<$view field="title" format="text"/> + + + diff --git a/core/ui/TagEditTemplate.tid b/core/ui/TagEditTemplate.tid new file mode 100644 index 000000000..73a834903 --- /dev/null +++ b/core/ui/TagEditTemplate.tid @@ -0,0 +1,16 @@ +title: $:/core/ui/TagEditTemplate + +\define tag-styles() +background-color:$(backgroundColor)$; +\end +<$set name="backgroundColor" value={{!!color}}> +<$button popup=<> class="btn-invisible tw-tag-label" style=<>> +<$view field="title" format="text" /> +<$button message="tw-remove-tag" param={{!!title}} class="btn-invisible tw-remove-tag-button">× + + +<$reveal state=<> type="popup" position="below" animate="yes">
<$transclude tiddler="$:/core/ui/ListItemTemplate"/> +
+<$list filter="[is[current]tagging[]]" template="$:/core/ui/ListItemTemplate"/> +
+ \ No newline at end of file