From e184ca95001acfaf36328fa55b43cd10bb4f483d Mon Sep 17 00:00:00 2001 From: pmario Date: Wed, 17 Jul 2024 00:27:00 +0200 Subject: [PATCH] simplify code - make sure the item is visible when dragged --- .../macros/list-links-horizontal-draggable.tid | 17 ++++++++--------- .../Weekdays/Days of the Week.tid | 2 +- ...ks-horizontal-draggable Macro (Examples).tid | 8 +++++++- ...ist-links-horizontal-draggable Procedure.tid | 4 ++-- themes/tiddlywiki/vanilla/base.tid | 8 +------- 5 files changed, 19 insertions(+), 20 deletions(-) diff --git a/core/wiki/macros/list-links-horizontal-draggable.tid b/core/wiki/macros/list-links-horizontal-draggable.tid index 6ef29793f..8de193e67 100644 --- a/core/wiki/macros/list-links-horizontal-draggable.tid +++ b/core/wiki/macros/list-links-horizontal-draggable.tid @@ -12,14 +12,14 @@ tags: $:/tags/Macro $:/tags/Global \end -\procedure list-links-horizontal-draggable(tiddler,field:"list",emptyMessage,type:"span",subtype:"span",class:"",itemTemplate,dragHandle:"yes",enable:"yes") +\procedure list-links-horizontal-draggable(tiddler,field:"list",emptyMessage,type:"span",subtype:"span",class:"",itemTemplate,dragHandle:"⠿",enable:"yes") \procedure customSort() [getenlist-input[]] :sort:alphanumeric:caseinsensitive[subfilter{$:/config/Tags/CustomSort/subfilter}] <$let targetTiddler=<> targetField=<> _enable={{{ [!match[no]thenelse[yes]] }}} - _dragHandle={{{ [<_enable>match[yes]thenelse[no]] }}} + _dragHandle={{{ [<_enable>match[yes]thenelse[]] }}} > <$log/> <$genesis $type=<> class=<>> @@ -30,16 +30,15 @@ tags: $:/tags/Macro $:/tags/Global enable=<<_enable>> > - <% if [<_dragHandle>match[yes]] %> - <$draggable tiddler={{!!title}} tag="span" - class="tc-draggable-handle" - /> - <% endif %> <$draggable tiddler={{!!title}} tag="span" - enable={{{ [<_dragHandle>!match[yes]then<_enable>else[no]] }}} + enable=<<_enable>> class="tc-horizontal-draggable-item" > - + <% if [<_dragHandle>!is[blank]] %> + + <<_dragHandle>> + + <% endif %> <% if [is[variable]] %> <$transclude $variable=<>> <> diff --git a/editions/tw5.com/tiddlers/demonstrations/Weekdays/Days of the Week.tid b/editions/tw5.com/tiddlers/demonstrations/Weekdays/Days of the Week.tid index 06e64ce85..f37b9d893 100644 --- a/editions/tw5.com/tiddlers/demonstrations/Weekdays/Days of the Week.tid +++ b/editions/tw5.com/tiddlers/demonstrations/Weekdays/Days of the Week.tid @@ -1,6 +1,6 @@ created: 20150117192110000 list: Monday Tuesday Wednesday Thursday Friday Saturday Sunday -modified: 20211116221246915 +modified: 20240716222620082 my-special-list: [[listed Operator (Examples)]] short: Mon Tue Wed Thu Fri Sat Sun tags: [[Operator Examples]] diff --git a/editions/tw5.com/tiddlers/macros/examples/list-links-horizontal-draggable Macro (Examples).tid b/editions/tw5.com/tiddlers/macros/examples/list-links-horizontal-draggable Macro (Examples).tid index 810d7ff43..a963edcc1 100644 --- a/editions/tw5.com/tiddlers/macros/examples/list-links-horizontal-draggable Macro (Examples).tid +++ b/editions/tw5.com/tiddlers/macros/examples/list-links-horizontal-draggable Macro (Examples).tid @@ -1,6 +1,12 @@ created: 20240712134945885 -modified: 20240712135014913 +modified: 20240716222408892 title: list-links-horizontal-draggable Macro (Examples) type: text/vnd.tiddlywiki <$macrocall $name=".example" n="1" eg="""<>"""/> + +<$macrocall $name=".example" n="2" eg="""<>"""/> + +<$macrocall $name=".example" n="3" eg="""<>"""/> + +<$macrocall $name=".example" n="4" eg="""<>"""/> diff --git a/editions/tw5.com/tiddlers/macros/list-links-horizontal-draggable Procedure.tid b/editions/tw5.com/tiddlers/macros/list-links-horizontal-draggable Procedure.tid index b6b23e777..8651b9bb4 100644 --- a/editions/tw5.com/tiddlers/macros/list-links-horizontal-draggable Procedure.tid +++ b/editions/tw5.com/tiddlers/macros/list-links-horizontal-draggable Procedure.tid @@ -1,6 +1,6 @@ caption: list-links-horizontal-draggable created: 20240712134619467 -modified: 20240716135427247 +modified: 20240716221918196 tags: Macros [[Core Macros]] title: list-links-horizontal-draggable Procedure type: text/vnd.tiddlywiki @@ -33,7 +33,7 @@ The <<.def list-links-horizontal-draggable>> [[procedure|Procedures]] renders th : Optional title of a tiddler to use as the template for rendering list items ; dragHandle -: Defaults to: ''yes''. If shows a drag handle: `⠿` in front of every item. If set to ''no'' the handle is removed +: Defaults to: `⠿`. It shows ⠿ in front of every item. If set to an ''empty string'' the handle is removed ; enable : Defaults to: ''yes''. If set to ''no'' the draggability function and the handles are removed diff --git a/themes/tiddlywiki/vanilla/base.tid b/themes/tiddlywiki/vanilla/base.tid index 2069424b4..cc2de6aab 100644 --- a/themes/tiddlywiki/vanilla/base.tid +++ b/themes/tiddlywiki/vanilla/base.tid @@ -543,8 +543,7 @@ a.tc-tiddlylink-external:hover { } /* content: braille pattern 283F */ -.tc-draggable-handle::before { - content: '⠿'; +.tc-draggable-handle { cursor: ew-resize; display: inline-block; } @@ -575,11 +574,6 @@ a.tc-tiddlylink-external:hover { display: block; min-height: 2em; } - .tc-draggable-handle::before { - content: '⠿'; - padding-left: 10px; - padding-right: 7px; - } }