loleaflet/src/control/Control.NotebookbarBuilder.js |   14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

New commits:
commit fcc6f1cd17ce4b2ab12b7b7161da2598696caaa6
Author:     Szymon Kłos <szymon.k...@collabora.com>
AuthorDate: Wed Jul 1 11:04:20 2020 +0200
Commit:     Szymon Kłos <szymon.k...@collabora.com>
CommitDate: Wed Jul 1 12:33:47 2020 +0200

    notebookbar: fix comboboxes
    
    Change-Id: I5f7c2fbf31d8b0babca3b96424138aa0a38e3676
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97599
    Tested-by: Jenkins
    Reviewed-by: Szymon Kłos <szymon.k...@collabora.com>

diff --git a/loleaflet/src/control/Control.NotebookbarBuilder.js 
b/loleaflet/src/control/Control.NotebookbarBuilder.js
index 3c01a12aa..dc00ace4b 100644
--- a/loleaflet/src/control/Control.NotebookbarBuilder.js
+++ b/loleaflet/src/control/Control.NotebookbarBuilder.js
@@ -142,7 +142,7 @@ L.Control.NotebookbarBuilder = 
L.Control.JSDialogBuilder.extend({
                if (commandName === '.uno:CharFontName') {
                        $('#fontnamecombobox').val(state).trigger('change');
                } else if (commandName === '.uno:FontHeight') {
-                       $('#fontsize').val(state).trigger('change');
+                       $('#fontsize').val(parseFloat(state)).trigger('change');
                } else if (commandName === '.uno:StyleApply') {
                        $('#applystyle').val(state).trigger('change');
                }
@@ -153,7 +153,7 @@ L.Control.NotebookbarBuilder = 
L.Control.JSDialogBuilder.extend({
 
                if (id === 'fontnamecombobox') {
                        $(combobox).on('select2:select', function (e) {
-                               var font = e.target.value;
+                               var font = e.params.data.text;
                                builder.map.applyFont(font);
                                builder.map.focus();
                        });
@@ -163,7 +163,7 @@ L.Control.NotebookbarBuilder = 
L.Control.JSDialogBuilder.extend({
                }
                else if (id === 'fontsize') {
                        $(combobox).on('select2:select', function (e) {
-                               builder.map.applyFontSize(e.target.value);
+                               
builder.map.applyFontSize(parseFloat(e.params.data.text));
                                builder.map.focus();
                        });
 
@@ -208,8 +208,14 @@ L.Control.NotebookbarBuilder = 
L.Control.JSDialogBuilder.extend({
 
                data.entries.forEach(function (value, index) {
                        var selected = parseInt(data.selectedEntries[0]) == 
index;
-                       processedData.push({id: index, text: value, selected: 
selected});
+                       var id = index;
+                       if (data.id === 'fontsize')
+                               id = parseFloat(value);
+                       if (data.id === 'fontnamecombobox')
+                               id = value;
+                       processedData.push({id: id, text: value, selected: 
selected});
                });
+               console.log(processedData);
 
                $(select).select2({
                        data: processedData,
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to