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
-- AddLoot
, showModal : Bool
, autoComplete : Loot
, newItem : Maybe Item
, sourceName : Maybe String
@@ -67,6 +68,7 @@ init (Player navKey playerId) =
View
Nothing
Nothing
False
[]
Nothing
Nothing
@@ -520,7 +522,7 @@ viewAddLoot model =
False
showModal =
False
model.state.showModal
newItem =
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-body" ]
[ 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
| SetContent ChestContent
| SetSelection (Maybe Selection)
| SearchTextChanged String
| SwitchSelectionState Int
| GotLoot ToChest (HttpResult Loot)
| GotClaims (HttpResult Claims)
| GotPlayer (HttpResult Api.Player)
| SwitchSelectionState Int
| SearchTextChanged String
| ModeSwitched ActionMode
| OnModeEnter ActionMode
| OnModeExit ActionMode
@@ -721,6 +728,7 @@ type Msg
| NewItemPriceChanged String
| SourceNameChanged String
| SetNewItem Item
| OpenModal
insensitiveContains : String -> String -> Bool
@@ -731,6 +739,13 @@ insensitiveContains substring string =
update : Msg -> Model -> ( Model, Cmd Msg )
update msg model =
case msg of
OpenModal ->
let
state =
model.state
in
( { model | state = { state | showModal = True } }, Cmd.none )
NewItemAdded item ->
let
state =