mirror of
https://github.com/NoRedInk/noredink-ui.git
synced 2024-11-28 18:24:04 +03:00
Pull up the invisible label behavior higher
This commit is contained in:
parent
8a1442c105
commit
aaf993a5bf
@ -76,14 +76,17 @@ type alias Model msg =
|
||||
-}
|
||||
view : Assets a -> Model msg -> Html.Html msg
|
||||
view assets model =
|
||||
buildCheckbox assets [] False model
|
||||
buildCheckbox assets [] model <|
|
||||
Html.span [ Accessibility.Styled.Style.invisible ]
|
||||
[ Html.text model.label ]
|
||||
|
||||
|
||||
{-| Shows a checkbox and its label text
|
||||
-}
|
||||
viewWithLabel : Assets a -> Model msg -> Html.Html msg
|
||||
viewWithLabel assets model =
|
||||
buildCheckbox assets [] True model
|
||||
buildCheckbox assets [] model <|
|
||||
Html.span [] [ Html.text model.label ]
|
||||
|
||||
|
||||
{-| Show a disabled checkbox.
|
||||
@ -186,7 +189,6 @@ premium assets config =
|
||||
in
|
||||
buildCheckbox assets
|
||||
modifierClasses
|
||||
True
|
||||
{ identifier = config.id
|
||||
, label = config.label
|
||||
, setterMsg =
|
||||
@ -199,26 +201,23 @@ premium assets config =
|
||||
, theme = theme
|
||||
, noOpMsg = config.noOpMsg
|
||||
}
|
||||
<|
|
||||
Html.span [] [ Html.text config.label ]
|
||||
|
||||
|
||||
{-| -}
|
||||
viewAttention : Assets a -> Model msg -> Html.Html msg
|
||||
viewAttention assets model =
|
||||
buildCheckbox assets [ "WithPulsing" ] False model
|
||||
buildCheckbox assets [ "WithPulsing" ] model <|
|
||||
Html.span [ Accessibility.Styled.Style.invisible ]
|
||||
[ Html.text model.label ]
|
||||
|
||||
|
||||
buildCheckbox : Assets a -> List String -> Bool -> Model msg -> Html.Html msg
|
||||
buildCheckbox assets modifierClasses showLabels model =
|
||||
buildCheckbox : Assets a -> List String -> Model msg -> Html.Html msg -> Html.Html msg
|
||||
buildCheckbox assets modifierClasses model labelContent =
|
||||
let
|
||||
toClassList =
|
||||
List.map (\a -> ( "checkbox-" ++ a, True )) >> Attributes.classList
|
||||
|
||||
labelContent =
|
||||
if showLabels then
|
||||
Html.span [] [ Html.text model.label ]
|
||||
else
|
||||
Html.span [ Accessibility.Styled.Style.invisible ]
|
||||
[ Html.text model.label ]
|
||||
in
|
||||
viewCheckbox model <|
|
||||
case model.theme of
|
||||
|
Loading…
Reference in New Issue
Block a user