loleaflet/css/device-mobile.css             |    9 ---------
 loleaflet/css/toolbar-mobile.css            |    1 +
 loleaflet/css/toolbar.css                   |    1 -
 loleaflet/src/control/Control.FormulaBar.js |   11 ++++++++++-
 loleaflet/src/control/Control.LokDialog.js  |   18 ++++++++++++++++++
 loleaflet/src/map/Map.js                    |   16 +---------------
 6 files changed, 30 insertions(+), 26 deletions(-)

New commits:
commit dd300b2e81679060ee1a2cbc7b8b23272c13cdb7
Author:     Szymon Kłos <szymon.k...@collabora.com>
AuthorDate: Tue Sep 8 16:30:13 2020 +0200
Commit:     Szymon Kłos <szymon.k...@collabora.com>
CommitDate: Tue Sep 8 16:34:32 2020 +0200

    Fix formulabar on mobile
    
    Don't cover column headers. Show/hide on permission change.
    
    Change-Id: Iedb1aa38e722f8fe90d8246cc030a0b7949d1be2

diff --git a/loleaflet/css/device-mobile.css b/loleaflet/css/device-mobile.css
index c12126a04..f8477cf38 100644
--- a/loleaflet/css/device-mobile.css
+++ b/loleaflet/css/device-mobile.css
@@ -189,15 +189,6 @@ div#w2ui-overlay-actionbar.w2ui-overlay{
 }
 
 /* Related to selectionMarkers.css */
-#tb_formulabar_item_formula, #tb_formulabar_item_address {
-       height: 54px !important;
-}
-#tb_formulabar_item_formula > div, #tb_formulabar_item_address > div {
-       margin-top: -16px;
-}
-#tb_formulabar_item_functiondialog > div {
-       margin-top: -20px;
-}
 .inputbar_multiline #tb_formulabar_item_formula > div,
 .inputbar_multiline #tb_formulabar_item_address > div {
        margin-top:0px;
diff --git a/loleaflet/css/toolbar-mobile.css b/loleaflet/css/toolbar-mobile.css
index 59c308ec7..19168e2c9 100644
--- a/loleaflet/css/toolbar-mobile.css
+++ b/loleaflet/css/toolbar-mobile.css
@@ -5,6 +5,7 @@
        }
        #toolbar-wrapper{
                border-top: none;
+               top: 0px;
        }
        #toolbar-up{
                top:-1px;
diff --git a/loleaflet/css/toolbar.css b/loleaflet/css/toolbar.css
index 74272cb03..0cfb9aaf4 100644
--- a/loleaflet/css/toolbar.css
+++ b/loleaflet/css/toolbar.css
@@ -84,7 +84,6 @@ w2ui-toolbar {
 
 #formulabar {
                border-top: 1px solid #bbbbbb;
-               height: 30px;
 }
 
 #presentation-toolbar {
diff --git a/loleaflet/src/control/Control.FormulaBar.js 
b/loleaflet/src/control/Control.FormulaBar.js
index 60fd848d9..e6bcfcb4b 100644
--- a/loleaflet/src/control/Control.FormulaBar.js
+++ b/loleaflet/src/control/Control.FormulaBar.js
@@ -93,7 +93,10 @@ L.Control.FormulaBar = L.Control.extend({
        onDocLayerInit: function() {
                var docType = this.map.getDocType();
                if (docType == 'spreadsheet') {
-                       $('#formulabar').show();
+                       if (window.mode.isMobile())
+                               $('#formulabar').hide();
+                       else
+                               $('#formulabar').show();
                }
        },
 
@@ -102,6 +105,10 @@ L.Control.FormulaBar = L.Control.extend({
                var toolbar = w2ui.formulabar;
 
                if (e.perm === 'edit') {
+                       $('#formulabar').show();
+
+                       this.map.dialog.refreshCalcInputBar(0);
+
                        // Enable formula bar
                        $('#addressInput').prop('disabled', false);
                        $('#formulaInput').prop('disabled', false);
@@ -112,6 +119,8 @@ L.Control.FormulaBar = L.Control.extend({
                                });
                        }
                } else {
+                       $('#formulabar').hide();
+
                        // Disable formula bar
                        $('#addressInput').prop('disabled', true);
                        $('#formulaInput').prop('disabled', true);
diff --git a/loleaflet/src/control/Control.LokDialog.js 
b/loleaflet/src/control/Control.LokDialog.js
index c1abe867f..892306e03 100644
--- a/loleaflet/src/control/Control.LokDialog.js
+++ b/loleaflet/src/control/Control.LokDialog.js
@@ -929,6 +929,24 @@ L.Control.LokDialog = L.Control.extend({
                }
        },
 
+       refreshCalcInputBar: function(deckOffset) {
+               if (this._calcInputBar && !this._calcInputBar.isPainting) {
+                       var id = this._calcInputBar.id;
+                       var calcInputbar = L.DomUtil.get('calc-inputbar');
+                       if (calcInputbar) {
+                               var calcInputbarContainer = 
calcInputbar.children[0];
+                               if (calcInputbarContainer) {
+                                       var width = 
calcInputbarContainer.clientWidth - deckOffset;
+                                       var height = 
calcInputbarContainer.clientHeight;
+                                       if (width > 0 && height > 0) {
+                                               console.log('_onResize: 
container width: ' + width + ', container height: ' + height + ', _calcInputBar 
width: ' + this._calcInputBar.width);
+                                               
this._map._socket.sendMessage('resizewindow ' + id + ' size=' + width + ',' + 
height);
+                                       }
+                               }
+                       }
+               }
+       },
+
        _createCalcInputbar: function(id, left, top, width, height, textLines) {
                console.log('_createCalcInputBar: start: id: ' + id + ', width: 
' + width + ', height: ' + height + ', textLines: ' + textLines);
                var strId = this._toStrId(id);
diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js
index e7c3b281d..673af34b8 100644
--- a/loleaflet/src/map/Map.js
+++ b/loleaflet/src/map/Map.js
@@ -1260,21 +1260,7 @@ L.Map = L.Evented.extend({
                        }
                }
 
-               if (this.dialog._calcInputBar && 
!this.dialog._calcInputBar.isPainting) {
-                       var id = this.dialog._calcInputBar.id;
-                       var calcInputbar = L.DomUtil.get('calc-inputbar');
-                       if (calcInputbar) {
-                               var calcInputbarContainer = 
calcInputbar.children[0];
-                               if (calcInputbarContainer) {
-                                       var width = 
calcInputbarContainer.clientWidth - deckOffset;
-                                       var height = 
calcInputbarContainer.clientHeight;
-                                       if (width > 0 && height > 0) {
-                                               console.log('_onResize: 
container width: ' + width + ', container height: ' + height + ', _calcInputBar 
width: ' + this.dialog._calcInputBar.width);
-                                               
this._socket.sendMessage('resizewindow ' + id + ' size=' + width + ',' + 
height);
-                                       }
-                               }
-                       }
-               }
+               this.dialog.refreshCalcInputBar(deckOffset);
        },
 
        makeActive: function() {
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to