Skip to content

Commit

Permalink
Add constant for main id
Browse files Browse the repository at this point in the history
  • Loading branch information
debois committed Dec 30, 2016
1 parent 213af82 commit 4eed163
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
6 changes: 3 additions & 3 deletions demo/Demo/Cards.elm
Original file line number Diff line number Diff line change
Expand Up @@ -168,12 +168,12 @@ table model =
code =
"""
Card.view
[ css "width" """" ++ toString wide ++ """px")
[ css "width" \"""" ++ toString wide ++ """px")
, Color.background (Color.color Color.DeepPurple Color.S300)
]
[ Card.media
[ css "background" "url('assets/table.jpg') center / cover"
, css "height" """" ++ toString (wide / 16 * 9) ++ """px")
, css "height" \"""" ++ toString (wide / 16 * 9) ++ """px")
]
[]
, Card.title [ ]
Expand Down Expand Up @@ -415,7 +415,7 @@ playing model =
code =
"""
Card.view
[ css "width" """" ++ toString wide ++ """px"
[ css "width" \"""" ++ toString wide ++ """px"
, Color.background (Color.color Color.Amber Color.S600)
]
[ Card.title
Expand Down
2 changes: 1 addition & 1 deletion demo/Demo/Elevation.elm
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ demo2 model =
++ """
, Options.center
]
[ text """"
[ text \""""
++ (toString k)
++ """" ]"""
in
Expand Down
11 changes: 10 additions & 1 deletion src/Material/Layout.elm
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ module Material.Layout
, react
, toggleDrawer
, transparentHeader
, mainId
)

{-| From the
Expand Down Expand Up @@ -118,6 +119,7 @@ be (assuming a tab width of 1384 pixels):
## Tabs
@docs fixedTabs, rippleTabs
@docs selectedTab, setTabsWidth
@docs mainId
## Header
@docs fixedHeader, fixedDrawer
Expand Down Expand Up @@ -217,6 +219,13 @@ setTabsWidth_ width model =
}


{-| HTML id of main contents container. Useful for, e.g., scroll-to-top.
-}
mainId : String
mainId =
"elm-mdl-layout-main"


{-| Component model.
-}
type alias Model =
Expand Down Expand Up @@ -961,7 +970,7 @@ view lift model options { drawer, header, tabs, main } =
Just ( "elm-mdl-obfuscator", obfuscator lift drawerIsVisible )
, contentDrawerButton |> Maybe.map ((,) "elm-drawer-button")
, Options.styled main_
[ id "elm-mdl-layout-main"
[ id mainId
, cs "mdl-layout__content"
, css "overflow-y" "visible" |> when (config.mode == Scrolling && config.fixedHeader)
, css "overflow-x" "visible" |> when (config.mode == Scrolling && config.fixedHeader)
Expand Down

0 comments on commit 4eed163

Please sign in to comment.