Scroll to the current item when going back from detail

The list view now supports an item id that will be scrolled to and is
highlighted with a shadow. When going back from detail view this is
now used to scroll to the currently viewed item.
This commit is contained in:
Eike Kettner
2020-09-14 18:43:04 +02:00
parent 913bfb611c
commit 3852c69da1
15 changed files with 131 additions and 52 deletions

View File

@ -65,7 +65,7 @@ defaultLayout model =
[ div [ class "ui fluid container" ]
[ a
[ class "header item narrow-item"
, Page.href HomePage
, Page.href (HomePage Nothing)
]
[ img
[ class "image"
@ -81,7 +81,7 @@ defaultLayout model =
]
, div [ class "main-content" ]
[ case model.page of
HomePage ->
HomePage _ ->
viewHome model
LoginPage _ ->
@ -174,7 +174,16 @@ viewLogin model =
viewHome : Model -> Html Msg
viewHome model =
Html.map HomeMsg (Page.Home.View.view model.flags model.uiSettings model.homeModel)
let
mid =
case model.page of
HomePage x ->
x
_ ->
Nothing
in
Html.map HomeMsg (Page.Home.View.view mid model.flags model.uiSettings model.homeModel)
menuEntry : Model -> Page -> List (Html Msg) -> Html Msg
@ -206,7 +215,7 @@ loginInfo model =
]
]
[ menuEntry model
HomePage
(HomePage Nothing)
[ img
[ class "image icon"
, src (model.flags.config.docspellAssetPath ++ "/img/logo-mc-96.png")