loleaflet/src/map/Map.js |    3 +++
 1 file changed, 3 insertions(+)

New commits:
commit 507dd0845951252b56619f78f7db51dd2d088716
Author:     Henry Castro <hcas...@collabora.com>
AuthorDate: Fri Nov 1 10:15:53 2019 -0400
Commit:     Henry Castro <hcas...@collabora.com>
CommitDate: Mon Nov 4 22:24:31 2019 +0100

    loleaflet: fire 'orientationchange' event
    
    In order to detect if the orientation of the device has changed, it is
    required to capture the window resize event. However, there is another
    event attached from iframe element called resize-detector. I am not sure
    how is used, but I do not want to cause any regression from desktop
    version just let's add another event listener and it will be fired on
    mobile case.
    
    Change-Id: I54b5ba9239a71216faae4757a0cc7d9826c443ff
    Reviewed-on: https://gerrit.libreoffice.org/81923
    Reviewed-by: Henry Castro <hcas...@collabora.com>
    Tested-by: Henry Castro <hcas...@collabora.com>

diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js
index cdd29af08..6efa95c04 100644
--- a/loleaflet/src/map/Map.js
+++ b/loleaflet/src/map/Map.js
@@ -151,6 +151,9 @@ L.Map = L.Evented.extend({
                if (window.mode.isMobile()) {
                        $(this.options.documentContainer).css('bottom', '0px');
                        $(this._resizeDetector).css('bottom', '0px');
+                       L.DomEvent.on(window, 'resize', function(e) {
+                               this.fire('orientationchange', e);
+                       }, this);
                }
 
                // When all these conditions are met, fire 
statusindicator:initializationcomplete
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to