mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-21 09:58:26 +00:00
Extend dropdown to display additional option info
Use this to display folder information when setting the folder on an item.
This commit is contained in:
@ -8,6 +8,8 @@ module Comp.Dropdown exposing
|
||||
, makeMultiple
|
||||
, makeSingle
|
||||
, makeSingleList
|
||||
, mkOption
|
||||
, setMkOption
|
||||
, update
|
||||
, view
|
||||
)
|
||||
@ -27,9 +29,15 @@ import Util.List
|
||||
type alias Option =
|
||||
{ value : String
|
||||
, text : String
|
||||
, additional : String
|
||||
}
|
||||
|
||||
|
||||
mkOption : String -> String -> Option
|
||||
mkOption value text =
|
||||
Option value text ""
|
||||
|
||||
|
||||
type alias Item a =
|
||||
{ value : a
|
||||
, option : Option
|
||||
@ -63,6 +71,11 @@ type alias Model a =
|
||||
}
|
||||
|
||||
|
||||
setMkOption : (a -> Option) -> Model a -> Model a
|
||||
setMkOption mkopt model =
|
||||
{ model | makeOption = mkopt }
|
||||
|
||||
|
||||
makeModel :
|
||||
{ multiple : Bool
|
||||
, searchable : Int -> Bool
|
||||
@ -508,4 +521,7 @@ renderOption item =
|
||||
, onClick (AddItem item)
|
||||
]
|
||||
[ text item.option.text
|
||||
, span [ class "small-info right-float" ]
|
||||
[ text item.option.additional
|
||||
]
|
||||
]
|
||||
|
Reference in New Issue
Block a user