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

New commits:
commit 70d2a7b9403d6672f34228beeb1a61f21895114d
Author:     Henry Castro <hcas...@collabora.com>
AuthorDate: Fri Nov 1 17:37:33 2019 -0400
Commit:     Henry Castro <hcas...@collabora.com>
CommitDate: Mon Nov 4 22:25:00 2019 +0100

    loleaflet: mobile: when the document tile layer was added also update
    
    the sizes
    
    When 'doclayerinit' is fired, a new document layer was added then it is
    necessary to update the sizes and the default auto zoom.
    
    Change-Id: Iece07bd5510789479f58e080b300525169539c6f
    Reviewed-on: https://gerrit.libreoffice.org/81925
    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 6efa95c04..f333fbe42 100644
--- a/loleaflet/src/map/Map.js
+++ b/loleaflet/src/map/Map.js
@@ -191,11 +191,6 @@ L.Map = L.Evented.extend({
                        }
                }, this);
                this.on('doclayerinit', function() {
-                       if (window._invalidateSize) {
-                               this._size = new L.Point(0,0);
-                               this._onResize();
-                               delete window._invalidateSize;
-                       }
                        if (!this.initComplete) {
                                this._fireInitComplete('doclayerinit');
                        }
@@ -211,8 +206,7 @@ L.Map = L.Evented.extend({
                                elem.parentNode.removeChild(elem);
                                elem = 
L.DomUtil.get('presentation-controls-wrapper');
                                elem.parentNode.removeChild(elem);
-                       }
-                       else if (this._docLayer._docType === 'presentation') {
+                       } else if (this._docLayer._docType === 'presentation') {
                                elem = 
L.DomUtil.get('spreadsheet-row-column-frame');
                                elem.parentNode.removeChild(elem);
                                elem = L.DomUtil.get('spreadsheet-toolbar');
@@ -224,6 +218,8 @@ L.Map = L.Evented.extend({
 
                        if (L.Browser.mobile)
                        {
+                               this._size = new L.Point(0,0);
+                               this._onResize();
                                this._socket.sendMessage('uno 
.uno:LOKSetMobile');
                        }
                });
@@ -1100,10 +1096,6 @@ L.Map = L.Evented.extend({
        },
 
        _onResize: function () {
-               if (!this || !this._docLayer) {
-                       window._invalidateSize = true;
-                       return;
-               }
                L.Util.cancelAnimFrame(this._resizeRequest);
                this._resizeRequest = L.Util.requestAnimFrame(
                        function () { this.invalidateSize({debounceMoveend: 
true}); }, this, false, this._container);
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to