Created
November 16, 2017 07:49
-
-
Save yoavmatchulsky/af320b5412b720151e4c255b299481d1 to your computer and use it in GitHub Desktop.
This file contains 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
is_landscape : -> | |
really_landscape = => | |
w = $(window) | |
w.width() >= w.height() | |
if @options.state.device.desktop | |
really_landscape() | |
else if window.orientation? | |
Math.abs(window.orientation) is 90 | |
else if window.matchMedia? | |
window.matchMedia('(orientation: landscape)').matches | |
else | |
really_landscape() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment