wires modal button

This commit is contained in:
2019-11-13 15:57:15 +01:00
parent 18f661ddf3
commit b20a582a42

View File

@@ -32,6 +32,7 @@ type alias State =
, notification : Maybe String , notification : Maybe String
-- AddLoot -- AddLoot
, showModal : Bool
, autoComplete : Loot , autoComplete : Loot
, newItem : Maybe Item , newItem : Maybe Item
, sourceName : Maybe String , sourceName : Maybe String
@@ -67,6 +68,7 @@ init (Player navKey playerId) =
View View
Nothing Nothing
Nothing Nothing
False
[] []
Nothing Nothing
Nothing Nothing
@@ -520,7 +522,7 @@ viewAddLoot model =
False False
showModal = showModal =
False model.state.showModal
newItem = newItem =
case model.state.newItem of case model.state.newItem of
@@ -645,7 +647,12 @@ viewAddLoot model =
[ div [ class "field-label is-medium" ] [ label [ class "label" ] [ text "ou" ] ] [ div [ class "field-label is-medium" ] [ label [ class "label" ] [ text "ou" ] ]
, div [ class "field-body" ] , div [ class "field-body" ]
[ div [ class "control" ] [ div [ class "control" ]
[ button [ class "button" ] [ text "Depuis une liste" ] ] [ button
[ class "button"
, onClick OpenModal
]
[ text "Depuis une liste" ]
]
] ]
] ]
] ]
@@ -707,11 +714,11 @@ type Msg
| ClearNotification | ClearNotification
| SetContent ChestContent | SetContent ChestContent
| SetSelection (Maybe Selection) | SetSelection (Maybe Selection)
| SearchTextChanged String | SwitchSelectionState Int
| GotLoot ToChest (HttpResult Loot) | GotLoot ToChest (HttpResult Loot)
| GotClaims (HttpResult Claims) | GotClaims (HttpResult Claims)
| GotPlayer (HttpResult Api.Player) | GotPlayer (HttpResult Api.Player)
| SwitchSelectionState Int | SearchTextChanged String
| ModeSwitched ActionMode | ModeSwitched ActionMode
| OnModeEnter ActionMode | OnModeEnter ActionMode
| OnModeExit ActionMode | OnModeExit ActionMode
@@ -721,6 +728,7 @@ type Msg
| NewItemPriceChanged String | NewItemPriceChanged String
| SourceNameChanged String | SourceNameChanged String
| SetNewItem Item | SetNewItem Item
| OpenModal
insensitiveContains : String -> String -> Bool insensitiveContains : String -> String -> Bool
@@ -731,6 +739,13 @@ insensitiveContains substring string =
update : Msg -> Model -> ( Model, Cmd Msg ) update : Msg -> Model -> ( Model, Cmd Msg )
update msg model = update msg model =
case msg of case msg of
OpenModal ->
let
state =
model.state
in
( { model | state = { state | showModal = True } }, Cmd.none )
NewItemAdded item -> NewItemAdded item ->
let let
state = state =