Always thread through the height to the panel container

This commit is contained in:
Tessa Kelly 2019-04-11 12:03:57 -07:00
parent 468dcbc2a6
commit c8b186bdda

View File

@ -147,16 +147,16 @@ viewModal config ((State { previousPanel }) as state) summary =
] ]
(case previousPanel of (case previousPanel of
Just ( direction, panelView ) -> Just ( direction, panelView ) ->
[ viewPreviousPanel direction panelView [ viewPreviousPanel config.height direction panelView
|> Tuple.mapSecond (Html.map (\_ -> config.parentMsg state)) |> Tuple.mapSecond (Html.map (\_ -> config.parentMsg state))
, ( labelledById , ( labelledById
, panelContainer [ Css.height config.height, Slide.animateIn direction ] currentPanel , panelContainer config.height [ Slide.animateIn direction ] currentPanel
) )
] ]
Nothing -> Nothing ->
[ ( labelledById [ ( labelledById
, panelContainer [ Css.height config.height ] currentPanel , panelContainer config.height [] currentPanel
) )
] ]
) )
@ -211,10 +211,11 @@ viewCurrentPanel parentMsg ({ current } as summary) =
) )
viewPreviousPanel : AnimationDirection -> Panel -> ( String, Html () ) viewPreviousPanel : Css.Vh -> AnimationDirection -> Panel -> ( String, Html () )
viewPreviousPanel direction previousPanel = viewPreviousPanel height direction previousPanel =
( panelId previousPanel ( panelId previousPanel
, panelContainer [ Slide.animateOut direction ] , panelContainer height
[ Slide.animateOut direction ]
[ viewIcon previousPanel.icon [ viewIcon previousPanel.icon
, Text.subHeading , Text.subHeading
[ span [ Html.Styled.Attributes.id (panelId previousPanel) ] [ Html.text previousPanel.title ] [ span [ Html.Styled.Attributes.id (panelId previousPanel) ] [ Html.text previousPanel.title ]
@ -230,14 +231,15 @@ viewPreviousPanel direction previousPanel =
) )
panelContainer : List Css.Style -> List (Html msg) -> Html msg panelContainer : Css.Vh -> List Css.Style -> List (Html msg) -> Html msg
panelContainer animationStyles panel = panelContainer height animationStyles panel =
div div
[ css [ css
[ -- Layout [ -- Layout
Css.minHeight (Css.px 400) Css.minHeight (Css.px 400)
, Css.minHeight (Css.px 360) , Css.minHeight (Css.px 360)
, Css.maxHeight <| Css.calc (Css.vh 100) Css.minus (Css.px 100) , Css.maxHeight <| Css.calc (Css.vh 100) Css.minus (Css.px 100)
, Css.height height
, Css.width (Css.px 600) , Css.width (Css.px 600)
, Css.margin3 (Css.px 35) (Css.px 21) (Css.px 25) , Css.margin3 (Css.px 35) (Css.px 21) (Css.px 25)