loleaflet/src/control/Control.JSDialogBuilder.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
New commits: commit 2b1d14c835ac7e04cdc4d8c064b9136b10751463 Author: Szymon Kłos <szymon.k...@collabora.com> AuthorDate: Thu Oct 17 13:31:35 2019 +0200 Commit: Szymon Kłos <szymon.k...@collabora.com> CommitDate: Thu Oct 17 13:32:07 2019 +0200 jsdialogs: make insert table working Change-Id: I7f2c7b190bf8ff438ee606213ac7eb7e73e03382 diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js index 1ec58c00b..245507f31 100644 --- a/loleaflet/src/control/Control.JSDialogBuilder.js +++ b/loleaflet/src/control/Control.JSDialogBuilder.js @@ -413,16 +413,16 @@ L.Control.JSDialogBuilder = L.Control.extend({ var minus = L.DomUtil.create('div', 'minus', controlsContainer); minus.innerHTML = '-'; - if (data.min) + if (data.min != undefined) $(spinfield).attr('min', data.min); - if (data.max) + if (data.max != undefined) $(spinfield).attr('max', data.max); if (data.enabled == 'false') $(spinfield).attr('disabled', 'disabled'); - if (data.text) + if (data.text != undefined) $(spinfield).attr('value', builder._cleanValueFromUnits(data.text)); else if (data.children && data.children.length) $(spinfield).attr('value', builder._cleanValueFromUnits(data.children[0].text)); @@ -720,7 +720,11 @@ L.Control.JSDialogBuilder = L.Control.extend({ builder._spinfieldControl(content, colsData, builder, function() { }); var buttonData = { text: _('Insert table') }; - builder._pushbuttonControl(content, buttonData, builder, function() { }); + builder._pushbuttonControl(content, buttonData, builder, function() { + var rowsCount = parseInt($('#rows > input.spinfield').get(0).value); + var colsCount = parseInt($('#cols > input.spinfield').get(0).value); + builder.map.sendUnoCommand('.uno:InsertTable?Columns=' + colsCount + '&Rows=' + rowsCount); + }); builder._explorableMenu(parentContainer, title, data.children, builder, content); }, _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits