Pull up the invisible label behavior higher

This commit is contained in:
Tessa Kelly 2018-06-15 11:17:11 -07:00
parent 8a1442c105
commit aaf993a5bf

View File

@ -76,14 +76,17 @@ type alias Model msg =
-} -}
view : Assets a -> Model msg -> Html.Html msg view : Assets a -> Model msg -> Html.Html msg
view assets model = 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 {-| Shows a checkbox and its label text
-} -}
viewWithLabel : Assets a -> Model msg -> Html.Html msg viewWithLabel : Assets a -> Model msg -> Html.Html msg
viewWithLabel assets model = viewWithLabel assets model =
buildCheckbox assets [] True model buildCheckbox assets [] model <|
Html.span [] [ Html.text model.label ]
{-| Show a disabled checkbox. {-| Show a disabled checkbox.
@ -186,7 +189,6 @@ premium assets config =
in in
buildCheckbox assets buildCheckbox assets
modifierClasses modifierClasses
True
{ identifier = config.id { identifier = config.id
, label = config.label , label = config.label
, setterMsg = , setterMsg =
@ -199,26 +201,23 @@ premium assets config =
, theme = theme , theme = theme
, noOpMsg = config.noOpMsg , noOpMsg = config.noOpMsg
} }
<|
Html.span [] [ Html.text config.label ]
{-| -} {-| -}
viewAttention : Assets a -> Model msg -> Html.Html msg viewAttention : Assets a -> Model msg -> Html.Html msg
viewAttention assets model = 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 a -> List String -> Model msg -> Html.Html msg -> Html.Html msg
buildCheckbox assets modifierClasses showLabels model = buildCheckbox assets modifierClasses model labelContent =
let let
toClassList = toClassList =
List.map (\a -> ( "checkbox-" ++ a, True )) >> Attributes.classList 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 in
viewCheckbox model <| viewCheckbox model <|
case model.theme of case model.theme of