Make the current drop target visible

This commit is contained in:
Eike Kettner
2020-05-24 17:48:02 +02:00
parent 90e039ceb3
commit 81a1b7af0b
2 changed files with 20 additions and 1 deletions

View File

@ -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)