Better define the page we are on (#126)

fixes #124
This commit is contained in:
Rok Garbas 2020-07-09 18:07:07 +02:00 committed by GitHub
parent 08c5d997dc
commit 9b796191a5
Failed to generate hash of commit
2 changed files with 8 additions and 1 deletions

View file

@ -360,7 +360,12 @@ viewNavigationItem :
-> Html Msg
viewNavigationItem url ( path, title ) =
li
[ classList [ ( "active", path == url.path ) ] ]
[ classList
[ ( "active"
, String.startsWith url.path path
)
]
]
[ a [ href path ] [ text title ] ]

View file

@ -45,6 +45,7 @@ import Html.Attributes
, classList
, href
, id
, placeholder
, type_
, value
)
@ -748,6 +749,7 @@ view path title model viewSuccess outMsg =
, id "search-query-input"
, autocomplete False
, autofocus True
, placeholder <| "Search for " ++ path
, onInput (\x -> outMsg (QueryInput x))
, value <| Maybe.withDefault "" model.query
]