diff options
Diffstat (limited to 'elm/Lib/Autocomplete.elm')
-rw-r--r-- | elm/Lib/Autocomplete.elm | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/elm/Lib/Autocomplete.elm b/elm/Lib/Autocomplete.elm index 733a1175..fa18efc4 100644 --- a/elm/Lib/Autocomplete.elm +++ b/elm/Lib/Autocomplete.elm @@ -6,6 +6,7 @@ module Lib.Autocomplete exposing , Msg , boardSource , tagSource + , vnSource , init , clear , update @@ -28,6 +29,7 @@ import Gen.Types exposing (boardTypes) import Gen.Api as GApi import Gen.Boards as GB import Gen.Tags as GT +import Gen.VN as GV type alias Config m a = @@ -95,6 +97,19 @@ tagSource = } +vnSource : SourceConfig m GApi.ApiVNResult +vnSource = + { source = Endpoint (\s -> GV.send { search = s }) + <| \x -> case x of + GApi.VNResult e -> Just e + _ -> Nothing + , view = \i -> + [ b [ class "grayedout" ] [ text <| "v" ++ String.fromInt i.id ++ ": " ] + , text i.title ] + , key = \i -> String.fromInt i.id + } + + type alias Model a = { visible : Bool , value : String |