Skip to content

Commit

Permalink
Resolve TODOs in comments
Browse files Browse the repository at this point in the history
  • Loading branch information
debois committed Aug 3, 2016
1 parent c4f5be9 commit dea51f5
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 41 deletions.
4 changes: 2 additions & 2 deletions demo/Demo.elm
Original file line number Diff line number Diff line change
Expand Up @@ -399,10 +399,10 @@ stylesheet =
border-width: 1px;
padding-left: 1.3ex;
border-color: rgb(255,82,82);
font-style: normal;
/* TODO: Really need a way to specify "secondary color" in
/* Really need a way to specify "secondary color" in
inline css.
*/
font-style: normal;
}
p, blockquote {
max-width: 40em;
Expand Down
4 changes: 2 additions & 2 deletions demo/Demo/Cards.elm
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ type Msg

update : Msg -> Model -> (Model, Cmd Msg)
update action model =
case Debug.log "" action of
case action of
Mdl action' ->
Material.update action' model

Expand Down Expand Up @@ -708,7 +708,7 @@ aux model =
, css "width" "128px"
, Color.background (Color.color Color.Pink Color.S500)
-- Elevation
, if Debug.log "" (model.raised == k) then Elevation.e8 else Elevation.e2
, if (model.raised == k) then Elevation.e8 else Elevation.e2
, Elevation.transition 250
, Options.attribute <| onMouseEnter (Raise k)
, Options.attribute <| onMouseLeave (Raise -1)
Expand Down
2 changes: 1 addition & 1 deletion demo/Demo/Menus.elm
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ type Msg

update : Msg -> Model -> (Model, Cmd Msg)
update action model =
case Debug.log "" action of
case action of
MDL action' ->
Material.update action' model

Expand Down
5 changes: 1 addition & 4 deletions demo/Demo/Page.elm
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,7 @@ fromMDS =
title : String -> Html a
title t =
Options.styled Html.h1
[ Color.text Color.primary
--, cs "mdl-typography--display-4"
-- TODO. Typography module
]
[ Color.text Color.primary ]
[ text t ]


Expand Down
2 changes: 1 addition & 1 deletion examples/Counter-many.elm
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ type Msg
map : Int -> (a -> a) -> Array a -> Array a
map k f a =
Array.get k a
|> Maybe.map (\x -> let y = Debug.log "" x in Array.set k (f y) a)
|> Maybe.map (\x -> Array.set k (f x) a)
|> Maybe.withDefault a


Expand Down
13 changes: 8 additions & 5 deletions src/Material/Grid.elm
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ module Material.Grid exposing
, align
, hide
, order
, stretch
)

{-| From the
Expand Down Expand Up @@ -64,11 +65,7 @@ Example use:
Cells are configured with a `List Style`; this configuration dictates the
size, offset, etc. of the cell.
@docs cell, Cell, Device, size, offset, Align, align, hide, order
-}


{- TODO. I don't understand what "mdl-cell--stretch" or when it might be appropriate.
@docs cell, Cell, Device, size, offset, Align, align, stretch, hide, order
-}


Expand Down Expand Up @@ -161,6 +158,12 @@ align a =
Bottom -> cs "mdl-cell--bottom"


{-| Specify that a cell stretches vertically to fill the parent.
-}
stretch : Style a
stretch =
cs "mdl-cell--stretch"


{-| Specify that a cell should be hidden on given `Device`.
-}
Expand Down
6 changes: 3 additions & 3 deletions src/Material/Layout.elm
Original file line number Diff line number Diff line change
Expand Up @@ -723,9 +723,9 @@ drawerButton lift =
"keydown"
{ stopPropagation = False
, preventDefault = False -- True
{- TODO: Should stop propagation exclusively on ENTER, but elm
currently require me to decide on options before the keycode value is
available. -}
{- Should stop propagation exclusively on ENTER, but elm
currently require me to decide on options before the keycode
value is available. -}
}
(Decoder.map
(lift << \key -> case key of
Expand Down
2 changes: 0 additions & 2 deletions src/Material/Snackbar.elm
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,4 @@ Component support for snackbar was implemented earlier. In case a solution
presents itself, the last commit to contain this support was:
f0a85912654713238694f48b1a4b7d5a7459965f
TODO
-}
18 changes: 0 additions & 18 deletions src/Material/Textfield.elm
Original file line number Diff line number Diff line change
Expand Up @@ -235,24 +235,6 @@ cols cols =
-- MODEL



{- Kind of textfield. Currently supports only single-line input or password
inputs.
| MultiLine (Maybe Int) -- Max no. of rows or no limit
-- TODO. Should prevent key event for ENTER
-- when number of rows exceeds maxrows argument to constructor:
MaterialTextfield.prototype.onKeyDown_ = function(event) {
var currentRowCount = event.target.value.split('\n').length;
if (event.keyCode === 13) {
if (currentRowCount >= this.maxRows) {
event.preventDefault();
}
}
};
-}


{-| Model. The textfield is in its error-container if `error` is not `Nothing`.
The contents of the field is `value`.
-}
Expand Down
5 changes: 2 additions & 3 deletions src/Material/Toggles.elm
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ viewCheckbox lift model config elems =
, class ("mdl-checkbox__input")
, Html.Attributes.disabled cfg.isDisabled
, checked cfg.value
{- TODO: the checked attribute is not rendered. Switch still seems to
{- The checked attribute is not rendered. Switch still seems to
work, though, but accessibility is probably compromised.
https://github.com/evancz/elm-html/issues/91
-}
Expand Down Expand Up @@ -249,7 +249,7 @@ viewSwitch lift model config elems =
, class "mdl-switch__input"
, Html.Attributes.disabled cfg.isDisabled
, checked cfg.value
{- TODO: the checked attribute is not rendered. Switch still seems to
{- the checked attribute is not rendered. Switch still seems to
work, though, but accessibility is probably compromised.
https://github.com/evancz/elm-html/issues/91
-}
Expand Down Expand Up @@ -278,7 +278,6 @@ viewRadio lift model config elems =
, Just (class "mdl-radio__button")
, Just (Html.Attributes.disabled cfg.isDisabled)
, Just (checked cfg.value)
-- TODO, Just (Html.Attributes.value cfg.value)
, cfg.group
]
)
Expand Down

0 comments on commit dea51f5

Please sign in to comment.