loleaflet/src/control/Control.JSDialogBuilder.js |   47 ++++++++++++++++-------
 loleaflet/src/control/Control.MobileWizard.js    |   11 +++--
 2 files changed, 40 insertions(+), 18 deletions(-)

New commits:
commit 4117d7d0483c2bf0cb3a544b42d92c1c6dda3f44
Author:     Szymon Kłos <szymon.k...@collabora.com>
AuthorDate: Tue Sep 24 14:32:33 2019 +0200
Commit:     Szymon Kłos <szymon.k...@collabora.com>
CommitDate: Fri Sep 27 17:03:54 2019 +0200

    jsdialogs: remove 'debug' styling
    
    Change-Id: Ib025c123c5023a61b75deaba27cc39248c703df0
    Reviewed-on: https://gerrit.libreoffice.org/79728
    Reviewed-by: Szymon Kłos <szymon.k...@collabora.com>
    Tested-by: Szymon Kłos <szymon.k...@collabora.com>

diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js 
b/loleaflet/src/control/Control.JSDialogBuilder.js
index 17c81c67b..6b041a8a2 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -190,10 +190,6 @@ L.Control.JSDialogBuilder = L.Control.extend({
                        else
                                childObject = currentInsertPlace;
 
-                       $(childObject).css('border-style', 'solid');
-                       $(childObject).css('border-width', '1px');
-                       $(childObject).css('border-color', 'black');
-
                        var handler = this._controlHandlers[childType];
 
                        if (handler)
commit afb1be4cd2c9788ecb9b56868ef5b5a15f0d4e69
Author:     Szymon Kłos <szymon.k...@collabora.com>
AuthorDate: Tue Sep 24 14:17:19 2019 +0200
Commit:     Szymon Kłos <szymon.k...@collabora.com>
CommitDate: Fri Sep 27 17:03:45 2019 +0200

    jsdialogs: multi-level menu, panel handler
    
    Change-Id: I0bfdbea299cbedb844d9479afac2c4dbca145753
    Reviewed-on: https://gerrit.libreoffice.org/79727
    Reviewed-by: Szymon Kłos <szymon.k...@collabora.com>
    Tested-by: Szymon Kłos <szymon.k...@collabora.com>

diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js 
b/loleaflet/src/control/Control.JSDialogBuilder.js
index ebd3e6843..17c81c67b 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -15,6 +15,8 @@ L.Control.JSDialogBuilder = L.Control.extend({
         */
        _controlHandlers: {},
 
+       _currentDepth: 0,
+
        _setup: function() {
                this._controlHandlers['radiobutton'] = this._radiobuttonControl;
                this._controlHandlers['checkbox'] = this._checkboxControl;
@@ -25,12 +27,14 @@ L.Control.JSDialogBuilder = L.Control.extend({
                this._controlHandlers['listbox'] = this._comboboxControl;
                this._controlHandlers['fixedtext'] = this._fixedtextControl;
                this._controlHandlers['frame'] = this._frameHandler;
+               this._controlHandlers['panel'] = this._panelHandler;
                this._controlHandlers['container'] = this._containerHandler;
                this._controlHandlers['window'] = this._containerHandler;
                this._controlHandlers['borderwindow'] = this._containerHandler;
                this._controlHandlers['control'] = this._containerHandler;
                this._controlHandlers['scrollbar'] = this._ignoreHandler;
                this._controlHandlers['toolbox'] = this._ignoreHandler;
+               this._currentDepth = 0;
        },
 
        _containerHandler: function() {
@@ -41,24 +45,43 @@ L.Control.JSDialogBuilder = L.Control.extend({
                return false;
        },
 
-       _frameHandler: function(parentContainer, data, builder) {
-               var titleNode = data.children[0];
-               var sectionTitle = L.DomUtil.create('div', 'ui-header 
mobile-wizard ui-widget', parentContainer);
-               sectionTitle.innerHTML = titleNode.text;
+       _explorableEntry: function(parentContainer, title, contentNode, 
builder) {
+               var sectionTitle = L.DomUtil.create('div', 'ui-header level-' + 
builder._currentDepth + ' mobile-wizard ui-widget', parentContainer);
+               sectionTitle.innerHTML = title;
 
-               var contentNode = data.children[1];
-               var contentDiv = L.DomUtil.create('div', 'ui-content 
mobile-wizard', parentContainer);
+               var contentDiv = L.DomUtil.create('div', 'ui-content level-' + 
builder._currentDepth + ' mobile-wizard', parentContainer);
+
+               builder._currentDepth++;
                builder.build(contentDiv, [contentNode]);
+               builder._currentDepth--;
 
                $(contentDiv).hide();
                $(sectionTitle).click(function() {
-                       $('.ui-header.mobile-wizard').hide('slide', { 
direction: 'left' }, 'fast', function() {
-                               $(contentDiv).show('slide', { direction: 
'right' }, 'fast');
-                       });
-                       builder.wizard._setTitle(titleNode.text);
+                       var titles = '.ui-header.level-' + 
builder.wizard._currentDepth + '.mobile-wizard';
+
+                       $(titles).hide('slide', { direction: 'left' }, 'fast', 
function() {});
+                       $(contentDiv).show('slide', { direction: 'right' }, 
'fast');
+
+                       builder.wizard._currentDepth++;
+                       builder.wizard._setTitle(title);
                        builder.wizard._inMainMenu = false;
                });
+       },
+
+       _frameHandler: function(parentContainer, data, builder) {
+               var title = data.children[0].text;
+               var contentNode = data.children[1];
+
+               builder._explorableEntry(parentContainer, title, contentNode, 
builder);
+
+               return false;
+       },
+
+       _panelHandler: function(parentContainer, data, builder) {
+               var title = data.children[0].id;
+               var contentNode = data.children[0];
 
+               builder._explorableEntry(parentContainer, title, contentNode, 
builder);
 
                return false;
        },
diff --git a/loleaflet/src/control/Control.MobileWizard.js 
b/loleaflet/src/control/Control.MobileWizard.js
index 4f6b672eb..dfbea872d 100644
--- a/loleaflet/src/control/Control.MobileWizard.js
+++ b/loleaflet/src/control/Control.MobileWizard.js
@@ -8,6 +8,7 @@ L.Control.MobileWizard = L.Control.extend({
 
        _inMainMenu: true,
        _isActive: false,
+       _currentDepth: 0,
 
        onAdd: function (map) {
                map.on('mobilewizard', this._onMobileWizard, this);
@@ -22,11 +23,13 @@ L.Control.MobileWizard = L.Control.extend({
                backButton.click(function() {
                        if (that._inMainMenu) {
                                that._hideWizard();
+                               that._currentDepth = 0;
                        } else {
-                               $('.ui-content.mobile-wizard').hide('slide', { 
direction: 'right' }, 'fast', function() {
-                                       
$('.ui-header.mobile-wizard').show('slide', { direction: 'left' }, 'fast');
-                               });
-                               that._inMainMenu = true;
+                               that._currentDepth--;
+                               $('.ui-content.level-' + that._currentDepth + 
'.mobile-wizard').hide('slide', { direction: 'right' }, 'fast', function() {});
+                               $('.ui-header.level-' + that._currentDepth + 
'.mobile-wizard').show('slide', { direction: 'left' }, 'fast');
+                               if (that._currentDepth == 0)
+                                       that._inMainMenu = true;
                        }
                });
        },
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to