mirror of
https://github.com/typeable/elm-ui.git
synced 2024-11-27 14:35:05 +03:00
remove getViewport example code in docs
This commit is contained in:
parent
28aa3e1c86
commit
8237e65ef6
@ -189,18 +189,7 @@ The main technique for responsiveness is to store window size information in you
|
||||
|
||||
Install the `Browser` package, and set up a subscription for [`Browser.Events.onResize`](https://package.elm-lang.org/packages/elm/browser/latest/Browser-Events#onResize).
|
||||
|
||||
You'll also need to retrieve the initial window size. You can either use [`Browser.Dom.getViewport`](https://package.elm-lang.org/packages/elm/browser/latest/Browser-Dom#getViewport):
|
||||
|
||||
Task.perform
|
||||
(\window ->
|
||||
WindowResize
|
||||
{ width = round window.viewport.width
|
||||
, height = round window.viewport.height
|
||||
}
|
||||
)
|
||||
Browser.Dom.getViewport
|
||||
|
||||
Or pass in `window.innerWidth` and `window.innerHeight` as flags to your program, which is the preferred way. This requires minor setup on the JS side, but allows you to avoid the state where you don't have window info.
|
||||
You'll also need to retrieve the initial window size. You can either use [`Browser.Dom.getViewport`](https://package.elm-lang.org/packages/elm/browser/latest/Browser-Dom#getViewport) or pass in `window.innerWidth` and `window.innerHeight` as flags to your program, which is the preferred way. This requires minor setup on the JS side, but allows you to avoid the state where you don't have window info.
|
||||
|
||||
@docs Device, DeviceClass, Orientation, classifyDevice
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user