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 = ...@@ -305,15 +305,20 @@ viewNavigation model =
undo = ForRails RailPuzzle.undo 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 = link msg en de =
Html.a ( [ Html.a
[ HA.href "javascript: ;", HE.onClick msg ] [ HA.href "javascript: ;"]
[MultiLang.text en de] [MultiLang.text en de]
]
, [HE.onClick msg]
)
noclick : a -> (a,List b)
noclick x = (x,[])
in in
(( if model.flags.minimalInterface (( if model.flags.minimalInterface
then (::) then (::) <|
[ a main_page_url noclick <| [ a main_page_url
[ img [ img
[ HA.src "logo_negated.png" [ HA.src "logo_negated.png"
, HA.style , HA.style
...@@ -327,8 +332,8 @@ viewNavigation model = ...@@ -327,8 +332,8 @@ viewNavigation model =
else identity else identity
) <| ) <|
( if model.flags.showRestart ( if model.flags.showRestart
then (::) then (::) <|
[ Html.a noclick <| [ Html.a
[ HA.style [(,) "font-weight" "bold" ] [ HA.style [(,) "font-weight" "bold" ]
, HA.href "rails.html" , HA.href "rails.html"
] ]
...@@ -336,9 +341,9 @@ viewNavigation model = ...@@ -336,9 +341,9 @@ viewNavigation model =
] ]
else identity else identity
) <| ) <|
[ [ link (ForRails RailPuzzle.undo) "Undo" "Rückgängig"] [ link (ForRails RailPuzzle.undo) "Undo" "Rückgängig"
, [ link resetCars "Reset All Cars" "Zurücksetzen" ] , link resetCars "Reset All Cars" "Zurücksetzen"
, [ Html.span , noclick <| [ Html.span
[ HA.style [(,) "margin-right" "1em"] ] [ HA.style [(,) "margin-right" "1em"] ]
[ Html.text "Puzzle:"] [ Html.text "Puzzle:"]
, net_switcher , net_switcher
...@@ -351,15 +356,15 @@ viewNavigation model = ...@@ -351,15 +356,15 @@ viewNavigation model =
] ]
] ]
[ if (hasNextPuzzle 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!" 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.filter (not << List.isEmpty << Tuple.first)
|> List.map (Html.li []) |> List.map (\(content,attr) -> Html.li attr content)
|> Html.ul [ HA.id "navigationbar" ] |> 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