loleaflet/src/control/Control.JSDialogBuilder.js |   21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

New commits:
commit 97d3d5c273cf41a79bce370f0570c97fd55f202e
Author:     Szymon Kłos <szymon.k...@collabora.com>
AuthorDate: Thu Oct 3 17:02:53 2019 +0200
Commit:     Szymon Kłos <szymon.k...@collabora.com>
CommitDate: Fri Oct 4 13:47:48 2019 +0200

    jsdialogs: Hide objects if needed
    
    Change-Id: Ic657f7d5668a0b38492fd4a29364e4e4b5b33976
    Reviewed-on: https://gerrit.libreoffice.org/80206
    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 85d76931f..23881b83d 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -204,6 +204,9 @@ L.Control.JSDialogBuilder = L.Control.extend({
                        builder.callback('radiobutton', 'change', radiobutton, 
this.checked, builder);
                });
 
+               if (data.hidden)
+                       $(radiobutton).hide();
+
                return false;
        },
 
@@ -224,6 +227,9 @@ L.Control.JSDialogBuilder = L.Control.extend({
                        builder.callback('checkbox', 'change', checkbox, 
this.checked, builder);
                });
 
+               if (data.hidden)
+                       $(checkbox).hide();
+
                return false;
        },
 
@@ -243,6 +249,9 @@ L.Control.JSDialogBuilder = L.Control.extend({
                        builder.callback('spinfield', 'change', spinfield, 
this.value, builder);
                });
 
+               if (data.hidden)
+                       $(spinfield).hide();
+
                return false;
        },
 
@@ -257,6 +266,9 @@ L.Control.JSDialogBuilder = L.Control.extend({
                        builder.callback('edit', 'change', edit, this.value, 
builder);
                });
 
+               if (data.hidden)
+                       $(edit).hide();
+
                return false;
        },
 
@@ -271,6 +283,9 @@ L.Control.JSDialogBuilder = L.Control.extend({
                        builder.callback('pushbutton', 'click', pushbutton, 
data.command, builder);
                });
 
+               if (data.hidden)
+                       $(pushbutton).hide();
+
                return false;
        },
 
@@ -298,6 +313,9 @@ L.Control.JSDialogBuilder = L.Control.extend({
                                $(option).attr('selected', 'selected');
                }
 
+               if (data.hidden)
+                       $(listbox).hide();
+
                listbox.addEventListener('change', function() {
                        builder.callback('combobox', 'change', listbox, 
this.value, builder);
                });
@@ -309,6 +327,9 @@ L.Control.JSDialogBuilder = L.Control.extend({
                var fixedtext = L.DomUtil.create('p', '', parentContainer);
                fixedtext.innerHTML = builder._cleanText(data.text);
 
+               if (data.hidden)
+                       $(fixedtext).hide();
+
                return false;
        },
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to