Skip to content

Commit

Permalink
Better define the page we are on
Browse files Browse the repository at this point in the history
fixes #124
  • Loading branch information
garbas committed Jul 9, 2020
1 parent 08c5d99 commit 5b21262
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Main.elm
Expand Up @@ -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 ] ]


Expand Down
2 changes: 2 additions & 0 deletions src/Search.elm
Expand Up @@ -45,6 +45,7 @@ import Html.Attributes
, classList
, href
, id
, placeholder
, type_
, value
)
Expand Down Expand Up @@ -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
]
Expand Down

0 comments on commit 5b21262

Please sign in to comment.