mirror of
https://github.com/typeable/elm-ui.git
synced 2024-11-27 14:35:05 +03:00
Merge pull request #91 from RosarioPulella/master
Make classifyDevice's DeviceClass based on the shorter side of the window.
This commit is contained in:
commit
b65a490c23
@ -1538,13 +1538,21 @@ type Orientation
|
||||
classifyDevice : { window | height : Int, width : Int } -> Device
|
||||
classifyDevice window =
|
||||
{ class =
|
||||
if window.width <= 600 then
|
||||
let
|
||||
shortSide =
|
||||
if window.width < window.height then
|
||||
window.width
|
||||
|
||||
else
|
||||
window.height
|
||||
in
|
||||
if shortSide <= 600 then
|
||||
Phone
|
||||
|
||||
else if window.width > 600 && window.width <= 1200 then
|
||||
else if shortSide > 600 && shortSide <= 1200 then
|
||||
Tablet
|
||||
|
||||
else if window.width > 1200 && window.width <= 1800 then
|
||||
else if shortSide > 1200 && shortSide <= 1800 then
|
||||
Desktop
|
||||
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user