[Libreoffice-commits] online.git: loleaflet/css loleaflet/src

Szymon KÅ‚os (via logerrit) logerrit at kemper.freedesktop.org
Mon Jun 29 06:43:15 UTC 2020


 loleaflet/css/notebookbar.css                       |    4 ++++
 loleaflet/src/control/Control.NotebookbarBuilder.js |   15 ++++++++++++++-
 loleaflet/src/control/Control.NotebookbarCalc.js    |    2 +-
 3 files changed, 19 insertions(+), 2 deletions(-)

New commits:
commit 7205cc301368e6deaf713390002328eb759e2466
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Tue Jun 23 07:49:18 2020 +0200
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Mon Jun 29 08:42:55 2020 +0200

    notebookbar: number format field
    
    Change-Id: Ie6047e917ecc7c78da5c9a45e6c253f451951555
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97231
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Tested-by: Jenkins
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>

diff --git a/loleaflet/css/notebookbar.css b/loleaflet/css/notebookbar.css
index ea8dfd0e7..12cb1af64 100644
--- a/loleaflet/css/notebookbar.css
+++ b/loleaflet/css/notebookbar.css
@@ -365,6 +365,10 @@ div[id*='Row'].notebookbar, div[id*='Column'].notebookbar, #SendToBack.notebookb
 	display: none;
 }
 
+#table-numbertype .select2.select2-container {
+	width: 170px !important;
+}
+
 /* Insert Tab */
 
 #table-InsertBox {
diff --git a/loleaflet/src/control/Control.NotebookbarBuilder.js b/loleaflet/src/control/Control.NotebookbarBuilder.js
index 66c66adf7..306baaf3d 100644
--- a/loleaflet/src/control/Control.NotebookbarBuilder.js
+++ b/loleaflet/src/control/Control.NotebookbarBuilder.js
@@ -189,6 +189,11 @@ L.Control.NotebookbarBuilder = L.Control.JSDialogBuilder.extend({
 
 			state = items.getItemValue('.uno:StyleApply');
 			$(combobox).val(state).trigger('change');
+		} else {
+			$(combobox).on('select2:select', function (e) {
+				var value = e.params.data.id + ';' + e.params.data.text;
+				builder.callback('combobox', 'selected', combobox, value, builder);
+			});
 		}
 	},
 
@@ -199,8 +204,16 @@ L.Control.NotebookbarBuilder = L.Control.JSDialogBuilder.extend({
 		var select = L.DomUtil.createWithId('select', data.id, parentContainer);
 		$(select).addClass(builder.options.cssClass);
 
+		var processedData = [];
+
+		data.entries.forEach(function (value, index) {
+			var selected = parseInt(data.selectedEntries[0]) == index;
+			processedData.push({id: index, text: value, selected: selected});
+		});
+		console.log(processedData);
+
 		$(select).select2({
-			data: data.entries.sort(function (a, b) {return a.localeCompare(b);}),
+			data: processedData,
 			placeholder: _(builder._cleanText(data.text))
 		});
 
diff --git a/loleaflet/src/control/Control.NotebookbarCalc.js b/loleaflet/src/control/Control.NotebookbarCalc.js
index 0a5df17cc..49f22a3ff 100644
--- a/loleaflet/src/control/Control.NotebookbarCalc.js
+++ b/loleaflet/src/control/Control.NotebookbarCalc.js
@@ -925,7 +925,7 @@ L.Control.NotebookbarCalc = L.Control.NotebookbarWriter.extend({
 																											'enabled': 'true',
 																											'children': [
 																												{
-																													'id': '',
+																													'id': 'numbertype',
 																													'type': 'listbox',
 																													'text': '',
 																													'enabled': 'true',


More information about the Libreoffice-commits mailing list