Commit 5038f985 authored by Thorsten Wißmann's avatar Thorsten Wißmann 🐧
Browse files

Make whole li item clickable in main navigation

parent 18e20411
......@@ -305,15 +305,20 @@ viewNavigation model =
undo = ForRails RailPuzzle.undo
link : msg -> String -> String -> Html msg
link : msg -> String -> String -> (List (Html msg), List (Html.Attribute msg))
link msg en de =
Html.a
[ HA.href "javascript: ;", HE.onClick msg ]
[MultiLang.text en de]
( [ Html.a
[ HA.href "javascript: ;"]
[MultiLang.text en de]
]
, [HE.onClick msg]
)
noclick : a -> (a,List b)
noclick x = (x,[])
in
(( if model.flags.minimalInterface
then (::)
[ a main_page_url
then (::) <|
noclick <| [ a main_page_url
[ img
[ HA.src "logo_negated.png"
, HA.style
......@@ -327,8 +332,8 @@ viewNavigation model =
else identity
) <|
( if model.flags.showRestart
then (::)
[ Html.a
then (::) <|
noclick <| [ Html.a
[ HA.style [(,) "font-weight" "bold" ]
, HA.href "rails.html"
]
......@@ -336,9 +341,9 @@ viewNavigation model =
]
else identity
) <|
[ [ link (ForRails RailPuzzle.undo) "Undo" "Rückgängig"]
, [ link resetCars "Reset All Cars" "Zurücksetzen" ]
, [ Html.span
[ link (ForRails RailPuzzle.undo) "Undo" "Rückgängig"
, link resetCars "Reset All Cars" "Zurücksetzen"
, noclick <| [ Html.span
[ HA.style [(,) "margin-right" "1em"] ]
[ Html.text "Puzzle:"]
, net_switcher
......@@ -351,15 +356,15 @@ viewNavigation model =
]
]
[ if (hasNextPuzzle model)
then link NextPuzzle "Next" "Weiter"
then Html.a [HA.href "javascript;", HE.onClick NextPuzzle] [MultiLang.text "Next" "Weiter"]
else MultiLang.text "Finished!" "Fertig!"
]
]
, [ Html.map ForMultiLang <| MultiLang.viewSwitcher model.languageSwitcher ]
, noclick <| [ Html.map ForMultiLang <| MultiLang.viewSwitcher model.languageSwitcher ]
]
)
|> List.filter (not << List.isEmpty)
|> List.map (Html.li [])
|> List.filter (not << List.isEmpty << Tuple.first)
|> List.map (\(content,attr) -> Html.li attr content)
|> Html.ul [ HA.id "navigationbar" ]
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment