loleaflet/src/control/Control.MobileWizard.js |   16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

New commits:
commit 298f4297c21f4b7cd5836b90bafcc803f13adb00
Author:     Pedro Pinto Silva <pedro.si...@collabora.com>
AuthorDate: Tue Jan 21 17:10:03 2020 +0100
Commit:     Pedro Pinto da Silva <pedro.si...@collabora.com>
CommitDate: Tue Jan 21 17:14:46 2020 +0100

    Mobile: MobileWizard: swipe/scroll indicator: improve scroll detection for 
different exceptions
    
    Change-Id: I2f3661b2eaafc8d8facb186e92738818431483e4
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/87153
    Reviewed-by: Pedro Pinto da Silva <pedro.si...@collabora.com>
    Tested-by: Pedro Pinto da Silva <pedro.si...@collabora.com>

diff --git a/loleaflet/src/control/Control.MobileWizard.js 
b/loleaflet/src/control/Control.MobileWizard.js
index 02fdc05cf..382838dc6 100644
--- a/loleaflet/src/control/Control.MobileWizard.js
+++ b/loleaflet/src/control/Control.MobileWizard.js
@@ -58,11 +58,16 @@ L.Control.MobileWizard = L.Control.extend({
 
        _showWizard: function(ContentsLength) {
                var docType = this._map.getDocType();
+               //console.log('ContentsLength: ' + ContentsLength + ' | 
docType: ' + docType + '$(#mobile-wizard-content).scrollTop();'  + 
'this._isTabMode: ' + this._isTabMode + ' | _tabs: ' + this._tabs);
                var maxScrolled = 52;
-               if (ContentsLength > 1 || docType != 'spreadsheet')
+               if (ContentsLength > 5 || this._tabs) {
+                       console.log('INDICATOR');
                        $('#mobile-wizard-content').append('<div 
id="mobile-wizard-scroll-indicator" style="width: 100%;height: 0px;position: 
fixed;z-index: 2;bottom: -7px;box-shadow: 0 -8px 20px 4px #0b87e770, 0 1px 10px 
6px #0b87e7;"></div>');
+               }
                if (docType == 'spreadsheet')
-                       maxScrolled = 41;
+                       maxScrolled = 30;
+               else if (docType == 'presentation')
+                       maxScrolled = 20;
                $('#mobile-wizard').show();
                $('#mobile-wizard-content').on('scroll', function() {
                        var mWizardContentScroll = 
$('#mobile-wizard-content').scrollTop();
@@ -285,7 +290,12 @@ L.Control.MobileWizard = L.Control.extend({
 
                        this._reset();
 
-                       this._showWizard(data.children.length);
+                       var mWizardContentLength;
+                       if (data.children[0].type == 'menuitem')
+                               mWizardContentLength = data.children.length;
+                       else mWizardContentLength = 
data.children[0].children.length;
+
+                       this._showWizard(mWizardContentLength);
                        this._hideKeyboard();
 
                        // Morph the sidebar into something prettier
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to