@deckdeckgo/utils
Advanced tools
Comparing version 1.6.0 to 1.7.0
@@ -0,1 +1,9 @@ | ||
<a name="1.7.0"></a> | ||
# 1.7.0 (2020-11-21) | ||
### Features | ||
- isLandscape and isPortrait | ||
<a name="1.6.0"></a> | ||
@@ -2,0 +10,0 @@ |
@@ -61,2 +61,11 @@ 'use strict'; | ||
} | ||
function isLandscape() { | ||
return !isPortrait(); | ||
} | ||
function isPortrait() { | ||
if (!window) { | ||
return false; | ||
} | ||
return window.matchMedia && window.matchMedia('(orientation: portrait)').matches; | ||
} | ||
@@ -181,3 +190,5 @@ function lazyLoadSelectedImages(images) { | ||
exports.isIPad = isIPad; | ||
exports.isLandscape = isLandscape; | ||
exports.isMobile = isMobile; | ||
exports.isPortrait = isPortrait; | ||
exports.isRTL = isRTL; | ||
@@ -184,0 +195,0 @@ exports.lazyLoadSelectedImages = lazyLoadSelectedImages; |
@@ -9,1 +9,3 @@ export declare function unifyEvent(e: any): any; | ||
export declare function isRTL(): boolean; | ||
export declare function isLandscape(): boolean; | ||
export declare function isPortrait(): boolean; |
@@ -57,1 +57,10 @@ export function unifyEvent(e) { | ||
} | ||
export function isLandscape() { | ||
return !isPortrait(); | ||
} | ||
export function isPortrait() { | ||
if (!window) { | ||
return false; | ||
} | ||
return window.matchMedia && window.matchMedia('(orientation: portrait)').matches; | ||
} |
{ | ||
"name": "@deckdeckgo/utils", | ||
"version": "1.6.0", | ||
"version": "1.7.0", | ||
"author": "David Dal Busco", | ||
@@ -5,0 +5,0 @@ "description": "A collection of utils methods and functions developed for DeckDeckGo", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17990
386