[Libreoffice-commits] online.git: loleaflet/src
Henry Castro (via logerrit)
logerrit at kemper.freedesktop.org
Mon Nov 4 21:24:25 UTC 2019
loleaflet/src/dom/DomUtil.js | 8 ++++++++
1 file changed, 8 insertions(+)
New commits:
commit 93265844c6ab5c7eaf056962f820efc331cfef6c
Author: Henry Castro <hcastro at collabora.com>
AuthorDate: Fri Nov 1 10:04:26 2019 -0400
Commit: Henry Castro <hcastro at collabora.com>
CommitDate: Mon Nov 4 22:24:07 2019 +0100
loleaflet: add DOM util functions: "isPortrait" and "isLandscape"
It is necessary to detect the mobile browser orientation.
Change-Id: I3281e4abac453c4f6de27e8d5e54bb0506fecf66
Reviewed-on: https://gerrit.libreoffice.org/81922
Reviewed-by: Henry Castro <hcastro at collabora.com>
Tested-by: Henry Castro <hcastro at collabora.com>
diff --git a/loleaflet/src/dom/DomUtil.js b/loleaflet/src/dom/DomUtil.js
index 91527ae63..82045a5d0 100644
--- a/loleaflet/src/dom/DomUtil.js
+++ b/loleaflet/src/dom/DomUtil.js
@@ -190,6 +190,14 @@ L.DomUtil = {
// so it's safe to cache the position for performance
return el._leaflet_pos;
+ },
+
+ isLandscape: function() {
+ return window.matchMedia && window.matchMedia('(orientation: landscape)').matches;
+ },
+
+ isPortrait: function() {
+ return window.matchMedia && window.matchMedia('(orientation: portrait)').matches;
}
};
More information about the Libreoffice-commits
mailing list