jsdialog: implemented multilineedit control

Change-Id: I1cda88437357f80cafbdcdbee03832af806a55d6
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93030
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
This commit is contained in:
Szymon Kłos 2020-03-06 12:30:35 +01:00
parent 762ca3d3ed
commit 1cf7c3a46c

View file

@ -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);