git.iko.soy/typeable/elm-ui
on master help sign in
remove getViewport example code in docs
commit8237e65ef624e1d26d5ed32f51fe0d611869c213 authorMatthew Griffith <mdg.griffith@gmail.com> dateWed 12 Jun 2019, 19:49 (7 years ago) parent28aa3e1
1 file changed+1−12
src/Element.elm+1−12
src/Element.elm+1−12
@@ -189,18 +189,7 @@ The main technique for responsiveness is to store window size information in you
189189
190190Install the `Browser` package, and set up a subscription for [`Browser.Events.onResize`](https://package.elm-lang.org/packages/elm/browser/latest/Browser-Events#onResize).
191191
192−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):
193−
194− Task.perform
195− (\window ->
196− WindowResize
197− { width = round window.viewport.width
198− , height = round window.viewport.height
199− }
200− )
201− Browser.Dom.getViewport
202−
203−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.
192+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.
204193
205194@docs Device, DeviceClass, Orientation, classifyDevice
206195