summaryrefslogtreecommitdiff
path: root/elm/UList/LabelEdit.elm
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2019-11-28 11:21:19 +0100
committerYorhel <git@yorhel.nl>2019-11-28 11:21:23 +0100
commit8825bb9df2487057bb65b69df67c93e7d793a37a (patch)
tree0a070d68abd5daf67f1526d5a7be3fa610d1d9c8 /elm/UList/LabelEdit.elm
parent4067f0a73a55e898def7320976781a2b8bf6710b (diff)
Use plain links for JS-ified linkradio inputs + fix focus of non-JS linkradios
Kind of backwards to use input elements to display a link when they're backed by Javascript anyway. This also avoids the need to create a unique id for each linkradio element.
Diffstat (limited to 'elm/UList/LabelEdit.elm')
-rw-r--r--elm/UList/LabelEdit.elm21
1 files changed, 9 insertions, 12 deletions
diff --git a/elm/UList/LabelEdit.elm b/elm/UList/LabelEdit.elm
index 1f2c229d..28f2cc68 100644
--- a/elm/UList/LabelEdit.elm
+++ b/elm/UList/LabelEdit.elm
@@ -76,19 +76,16 @@ view model =
str = String.join ", " <| List.filterMap (\l -> if Set.member l.id model.sel then Just l.label else Nothing) model.labels
item l =
- let lid = "label_edit_" ++ String.fromInt model.vid ++ "_" ++ String.fromInt l.id
- in
- li [ class "linkradio" ]
- [ inputCheck lid (Set.member l.id model.tsel) (Toggle l.id)
- , label [ for lid ]
- [ text l.label
- , text " "
- , span [ class "spinner", classList [("invisible", Dict.get l.id model.state /= Just Api.Loading)] ] []
- , case Dict.get l.id model.state of
- Just (Api.Error _) -> b [ class "standout" ] [ text "error" ] -- Need something better
- _ -> text ""
- ]
+ li [ ]
+ [ linkRadio (Set.member l.id model.tsel) (Toggle l.id)
+ [ text l.label
+ , text " "
+ , span [ class "spinner", classList [("invisible", Dict.get l.id model.state /= Just Api.Loading)] ] []
+ , case Dict.get l.id model.state of
+ Just (Api.Error _) -> b [ class "standout" ] [ text "error" ] -- Need something better
+ _ -> text ""
]
+ ]
in
DD.view model.dd
(if List.any (\s -> s == Api.Loading) <| Dict.values model.state then Api.Loading else Api.Normal)