loleaflet/src/dom/DomUtil.js |    8 ++++++++
 1 file changed, 8 insertions(+)

New commits:
commit 93265844c6ab5c7eaf056962f820efc331cfef6c
Author:     Henry Castro <hcas...@collabora.com>
AuthorDate: Fri Nov 1 10:04:26 2019 -0400
Commit:     Henry Castro <hcas...@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 <hcas...@collabora.com>
    Tested-by: Henry Castro <hcas...@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;
        }
 };
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to