mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-23 10:58:26 +00:00
Remove old ui code in frontend
This commit is contained in:
@ -3,13 +3,11 @@ module Comp.EmailInput exposing
|
||||
, Msg
|
||||
, init
|
||||
, update
|
||||
, view
|
||||
, view2
|
||||
)
|
||||
|
||||
import Api
|
||||
import Api.Model.ContactList exposing (ContactList)
|
||||
import Comp.Dropdown
|
||||
import Data.ContactType
|
||||
import Data.DropdownStyle as DS
|
||||
import Data.Flags exposing (Flags)
|
||||
@ -136,69 +134,6 @@ update flags current msg model =
|
||||
|
||||
|
||||
|
||||
--- View
|
||||
|
||||
|
||||
view : List String -> Model -> Html Msg
|
||||
view values model =
|
||||
div
|
||||
[ classList
|
||||
[ ( "ui search dropdown multiple selection", True )
|
||||
, ( "open", model.menuOpen )
|
||||
]
|
||||
]
|
||||
(List.map renderValue values
|
||||
++ [ input
|
||||
[ type_ "text"
|
||||
, class "search long-search"
|
||||
, placeholder "Recipients…"
|
||||
, onKeyUp KeyPress
|
||||
, onInput SetInput
|
||||
, value model.input
|
||||
]
|
||||
[]
|
||||
, renderMenu model
|
||||
]
|
||||
)
|
||||
|
||||
|
||||
renderValue : String -> Html Msg
|
||||
renderValue str =
|
||||
a
|
||||
[ class "ui label"
|
||||
, href "#"
|
||||
, onClick (RemoveEmail str)
|
||||
]
|
||||
[ text str
|
||||
, i [ class "delete icon" ] []
|
||||
]
|
||||
|
||||
|
||||
renderMenu : Model -> Html Msg
|
||||
renderMenu model =
|
||||
let
|
||||
mkItem v =
|
||||
a
|
||||
[ classList
|
||||
[ ( "item", True )
|
||||
, ( "active", model.active == Just v )
|
||||
]
|
||||
, href "#"
|
||||
, onClick (AddEmail v)
|
||||
]
|
||||
[ text v
|
||||
]
|
||||
in
|
||||
div
|
||||
[ classList
|
||||
[ ( "menu", True )
|
||||
, ( "transition visible", model.menuOpen )
|
||||
]
|
||||
]
|
||||
(List.map mkItem model.candidates)
|
||||
|
||||
|
||||
|
||||
--- View2
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user