loleaflet/src/control/Control.MobileWizard.js |    9 +++++++++
 loleaflet/src/map/Map.js                      |   16 ++++++++++++++--
 2 files changed, 23 insertions(+), 2 deletions(-)

New commits:
commit b783cb30e866b84a75b3ae7c3d08a39c42528b01
Author:     mert <mert.tu...@collabora.com>
AuthorDate: Fri Feb 7 15:48:58 2020 +0300
Commit:     Michael Meeks <michael.me...@collabora.com>
CommitDate: Mon Feb 17 22:27:04 2020 +0100

    mobilewizard: pan the document area to top on presentation
    
    WHen opening the wizard on presentation, the document is chopped in half
    and there are a lot of grey area on the top.
    
    Change-Id: I46bd329adcf551c94734998b240a251e1cec4e8d
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/88190
    Reviewed-by: Michael Meeks <michael.me...@collabora.com>
    Reviewed-by: Henry Castro <hcas...@collabora.com>
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>

diff --git a/loleaflet/src/control/Control.MobileWizard.js 
b/loleaflet/src/control/Control.MobileWizard.js
index 8c90f86f7..1dcf8a31b 100644
--- a/loleaflet/src/control/Control.MobileWizard.js
+++ b/loleaflet/src/control/Control.MobileWizard.js
@@ -109,6 +109,8 @@ L.Control.MobileWizard = L.Control.extend({
                if (!this.map.hasFocus()) {
                        this.map.focus();
                }
+
+               this._updateMapSize();
        },
 
        _hideKeyboard: function() {
@@ -268,6 +270,11 @@ L.Control.MobileWizard = L.Control.extend({
                }, 400);
        },
 
+       _updateMapSize: function() {
+               window.updateMapSizeForWizard = this._map.getDocType() === 
'presentation' && this._isActive;
+               this._map.invalidateSize();
+       },
+
        _onMobileWizard: function(data) {
                if (data) {
                        var isSidebar = (data.children && data.children.length 
>= 1 &&
@@ -333,6 +340,8 @@ L.Control.MobileWizard = L.Control.extend({
                                this._goToPath(currentPath);
                                this._scrollToPosition(lastScrollPosition);
                        }
+
+                       this._updateMapSize();
                }
        },
 
diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js
index ba848c2b2..cd2c8aad1 100644
--- a/loleaflet/src/map/Map.js
+++ b/loleaflet/src/map/Map.js
@@ -775,10 +775,22 @@ L.Map = L.Evented.extend({
        },
 
        getSize: function () {
+               var clientWidth = this._container.clientWidth;
+               var clientHeight = this._container.clientHeight;
+
+               if (window.updateMapSizeForWizard)
+               {
+                       var wizardHeight = $('#mobile-wizard').height();
+                       // the container has a bottom pixel set, it does not 
contain all the height
+                       // we need it for calculating how much pixels the 
wizard covers on the map
+                       var containerBottomPixels = 
parseInt($('#document-container').css('bottom'));
+                       clientHeight -= wizardHeight - containerBottomPixels;
+               }
+
                if (!this._size || this._sizeChanged) {
                        this._size = new L.Point(
-                               this._container.clientWidth,
-                               this._container.clientHeight);
+                               clientWidth,
+                               clientHeight);
 
                        this._sizeChanged = false;
                }
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to