Prefill share mail form

To have access to the translated content, the messages must be given
to the update function. There is no way to set the values in the view.
This commit is contained in:
eikek
2021-10-10 11:48:08 +02:00
parent 16ccddab9f
commit 9009ebcb39
7 changed files with 102 additions and 99 deletions

View File

@ -252,8 +252,6 @@ isValid model =
type alias ViewConfig =
{ withAttachments : Bool
, subjectTemplate : Maybe String
, bodyTemplate : Maybe String
, textAreaClass : String
, showCancel : Bool
}
@ -264,8 +262,6 @@ view2 texts settings model =
let
cfg =
{ withAttachments = True
, subjectTemplate = Nothing
, bodyTemplate = Nothing
, textAreaClass = ""
, showCancel = True
}
@ -357,11 +353,6 @@ view texts settings cfg model =
[ type_ "text"
, class S.textInput
, onInput SetSubject
, if model.subject == "" then
onFocus (SetSubject <| Maybe.withDefault "" cfg.subjectTemplate)
else
class ""
, value model.subject
]
[]
@ -373,11 +364,7 @@ view texts settings cfg model =
]
, textarea
[ onInput SetBody
, if model.body == "" then
value <| Maybe.withDefault "" cfg.bodyTemplate
else
value model.body
, value model.body
, class S.textAreaInput
, class cfg.textAreaClass
]