From 81a1b7af0bc371c3230cd6ea57f4d79d5324e93e Mon Sep 17 00:00:00 2001 From: Eike Kettner Date: Sun, 24 May 2020 17:48:02 +0200 Subject: [PATCH] Make the current drop target visible --- modules/webapp/src/main/elm/Comp/ItemDetail.elm | 17 ++++++++++++++++- modules/webapp/src/main/webjar/docspell.css | 4 ++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/modules/webapp/src/main/elm/Comp/ItemDetail.elm b/modules/webapp/src/main/elm/Comp/ItemDetail.elm index d14bc408..83c07598 100644 --- a/modules/webapp/src/main/elm/Comp/ItemDetail.elm +++ b/modules/webapp/src/main/elm/Comp/ItemDetail.elm @@ -1446,16 +1446,31 @@ renderAttachmentsTabMenu model = [ text "E-Mails" ] ] + + highlight el = + let + dropId = + DD.getDropId model.attachDD + + dragId = + DD.getDragId model.attachDD + + enable = + Just el.id == dropId && dropId /= dragId + in + [ ( "current-drop-target", enable ) + ] in div [ class "ui top attached tabular menu" ] (List.indexedMap (\pos -> \el -> a - ([ classList + ([ classList <| [ ( "item", True ) , ( "active", attachmentVisible model pos ) ] + ++ highlight el , title (Maybe.withDefault "No Name" el.name) , href "" , onClick (SetActiveAttachment pos) diff --git a/modules/webapp/src/main/webjar/docspell.css b/modules/webapp/src/main/webjar/docspell.css index ff0e3f8f..6e335da6 100644 --- a/modules/webapp/src/main/webjar/docspell.css +++ b/modules/webapp/src/main/webjar/docspell.css @@ -143,6 +143,10 @@ textarea.markdown-editor { background: rgba(240,248,255,0.4); } +.default-layout .ui.menu .item.current-drop-target { + background: rgba(0,0,0,0.2); +} + label span.muted { font-size: smaller; color: rgba(0,0,0,0.6);