Last active
December 31, 2015 14:33
-
-
Save etaque/19e7fca87c5673c30d6a to your computer and use it in GitHub Desktop.
Elm indentation for HTML
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- which style do you prefer? | |
-- commas/brackets first | |
rowView : Chart -> Html | |
rowView chart = | |
tr [] | |
[ th [] | |
[ text chart.label ] | |
, td | |
[ class "toggle" | |
, onClick Action.address (ToggleChart chart.id) | |
] | |
[ text <| if chart.visible then "<O>" else "<X> " ] | |
, td | |
[ class "remove" | |
, onClick Action.address (RemoveChart chart.id) | |
] | |
[ text "(X)" | |
] | |
] | |
-- commas/brackets last | |
rowView' : Chart -> Html | |
rowView' chart = | |
tr [] [ | |
th [] [ | |
text chart.label | |
], | |
td [ | |
class "toggle", | |
onClick Action.address (ToggleChart chart.id) | |
][ | |
text <| if chart.visible then "<O>" else "<X> " | |
], | |
td [ | |
class "remove", | |
onClick Action.address (RemoveChart chart.id) | |
][ | |
text "(X)" | |
] | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment