[Libreoffice-commits] online.git: 2 commits - loleaflet/src
Szymon Kłos (via logerrit)
logerrit at kemper.freedesktop.org
Fri Sep 27 15:04:39 UTC 2019
loleaflet/src/control/Control.JSDialogBuilder.js | 14 ++++++++++++++
1 file changed, 14 insertions(+)
New commits:
commit 8bfd0473ae3b706cbe1f2c67af51142f54029e95
Author: Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Wed Sep 25 10:27:15 2019 +0200
Commit: Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Fri Sep 27 17:04:28 2019 +0200
jsdialog: current selection in listbox
Change-Id: I652b196787dc9323c09681c4b4101b9474633c80
Reviewed-on: https://gerrit.libreoffice.org/79732
Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
Tested-by: Szymon Kłos <szymon.klos at collabora.com>
diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js
index 66931a071..c5e498a1d 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -154,9 +154,18 @@ L.Control.JSDialogBuilder = L.Control.extend({
if (data.enabled == 'false')
$(listbox).attr('disabled', 'disabled');
+ var selected = null;
+ if (parseInt(data.selectedCount) > 0) {
+ // TODO: multiselection listbox
+ selected = data.selectedEntries[0];
+ }
+
for (var index in data.entries) {
var option = L.DomUtil.create('option', '', listbox);
option.innerHTML = data.entries[index];
+
+ if (selected == index)
+ $(option).attr('selected', 'selected');
}
return false;
commit b580810092e926840a66568d7f01dc696aeeb141
Author: Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Wed Sep 25 10:18:38 2019 +0200
Commit: Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Fri Sep 27 17:04:20 2019 +0200
jsdialogs: read listbox entries
Change-Id: If4bce84fdb809269facc2855491fc8e59fee99b2
Reviewed-on: https://gerrit.libreoffice.org/79731
Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
Tested-by: Szymon Kłos <szymon.klos at collabora.com>
diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js
index 979ce5a20..66931a071 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -154,6 +154,11 @@ L.Control.JSDialogBuilder = L.Control.extend({
if (data.enabled == 'false')
$(listbox).attr('disabled', 'disabled');
+ for (var index in data.entries) {
+ var option = L.DomUtil.create('option', '', listbox);
+ option.innerHTML = data.entries[index];
+ }
+
return false;
},
More information about the Libreoffice-commits
mailing list