mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-02 13:32:51 +00:00
Visually indicate the last viewed item in the list
This commit is contained in:
parent
ad110b2a05
commit
09785292e7
@ -97,6 +97,7 @@ type Msg
|
|||||||
| KeyUpMsg (Maybe KeyCode)
|
| KeyUpMsg (Maybe KeyCode)
|
||||||
| SetContentOnly String
|
| SetContentOnly String
|
||||||
| ScrollResult (Result Dom.Error ())
|
| ScrollResult (Result Dom.Error ())
|
||||||
|
| ClearItemDetailId
|
||||||
|
|
||||||
|
|
||||||
type SearchType
|
type SearchType
|
||||||
|
@ -8,6 +8,7 @@ import Data.Flags exposing (Flags)
|
|||||||
import Data.UiSettings exposing (UiSettings)
|
import Data.UiSettings exposing (UiSettings)
|
||||||
import Page exposing (Page(..))
|
import Page exposing (Page(..))
|
||||||
import Page.Home.Data exposing (..)
|
import Page.Home.Data exposing (..)
|
||||||
|
import Process
|
||||||
import Scroll
|
import Scroll
|
||||||
import Task
|
import Task
|
||||||
import Throttle
|
import Throttle
|
||||||
@ -82,13 +83,13 @@ update mId key flags settings msg model =
|
|||||||
m
|
m
|
||||||
model.itemListModel
|
model.itemListModel
|
||||||
|
|
||||||
cmd =
|
( cmd, id ) =
|
||||||
case result.selected of
|
case result.selected of
|
||||||
Just item ->
|
Just item ->
|
||||||
Page.set key (ItemDetailPage item.id)
|
( Page.set key (ItemDetailPage item.id), Just item.id )
|
||||||
|
|
||||||
Nothing ->
|
Nothing ->
|
||||||
Cmd.none
|
( Cmd.none, Nothing )
|
||||||
in
|
in
|
||||||
withSub
|
withSub
|
||||||
( { model
|
( { model
|
||||||
@ -222,8 +223,15 @@ update mId key flags settings msg model =
|
|||||||
KeyUpMsg _ ->
|
KeyUpMsg _ ->
|
||||||
withSub ( model, Cmd.none )
|
withSub ( model, Cmd.none )
|
||||||
|
|
||||||
ScrollResult res ->
|
ScrollResult _ ->
|
||||||
withSub ( model, Cmd.none )
|
let
|
||||||
|
cmd =
|
||||||
|
Process.sleep 350 |> Task.perform (always ClearItemDetailId)
|
||||||
|
in
|
||||||
|
withSub ( model, cmd )
|
||||||
|
|
||||||
|
ClearItemDetailId ->
|
||||||
|
withSub ( model, Page.set key (HomePage Nothing) )
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user