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

New commits:
commit 1cf7c3a46ce7b80164a8c16aab035e3c5156f083
Author:     Szymon Kłos <szymon.k...@collabora.com>
AuthorDate: Fri Mar 6 12:30:35 2020 +0100
Commit:     Szymon Kłos <szymon.k...@collabora.com>
CommitDate: Tue Apr 28 10:12:47 2020 +0200

    jsdialog: implemented multilineedit control
    
    Change-Id: I1cda88437357f80cafbdcdbee03832af806a55d6
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93030
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-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 5bc0ac9ba..225e92ad9 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -110,6 +110,7 @@ L.Control.JSDialogBuilder = L.Control.extend({
                this._controlHandlers['checkbox'] = this._checkboxControl;
                this._controlHandlers['spinfield'] = this._spinfieldControl;
                this._controlHandlers['edit'] = this._editControl;
+               this._controlHandlers['multilineedit'] = 
this._multiLineEditControl;
                this._controlHandlers['pushbutton'] = this._pushbuttonControl;
                this._controlHandlers['combobox'] = this._comboboxControl;
                this._controlHandlers['comboboxentry'] = this._comboboxEntry;
@@ -1128,6 +1129,27 @@ L.Control.JSDialogBuilder = L.Control.extend({
                return false;
        },
 
+       _multiLineEditControl: function(parentContainer, data, builder, 
callback) {
+               var edit = L.DomUtil.create('textarea', '', parentContainer);
+               edit.value = builder._cleanText(data.text);
+               edit.id = data.id;
+
+               if (data.enabled == 'false')
+                       $(edit).attr('disabled', 'disabled');
+
+               edit.addEventListener('change', function() {
+                       if (callback)
+                               callback(this.value);
+                       else
+                               builder.callback('edit', 'change', edit, 
this.value, builder);
+               });
+
+               if (data.hidden)
+                       $(edit).hide();
+
+               return false;
+       },
+
        _pushbuttonControl: function(parentContainer, data, builder, 
customCallback) {
                var pushbutton = L.DomUtil.create('button', '', 
parentContainer);
                pushbutton.innerHTML = builder._cleanText(data.text);
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to