loleaflet/dist/toolbar/toolbar.js | 39 ++++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 20 deletions(-)
New commits: commit 0541af6795706c7951bff478415ccb39f61687e3 Author: Pranav Kant <pran...@collabora.co.uk> Date: Wed Dec 14 19:32:00 2016 +0530 loleaflet: Fix slide layout dropdown Combination of the following 3 commits from master: loleaflet: Refresh the toolbar Change-Id: I16fed0dd508ce6d3863157d316ab17898b680df5 (cherry picked from commit 07df52e45ad7c9478b3b404caf1445081122b50c) Signed-off-by: Andras Timar <andras.ti...@collabora.com> loleaflet: Check if this element exists before querying length eg: for spreadsheets Change-Id: Ie40fa27833fa0edb0e444a247895a1cb401b15b2 (cherry picked from commit 7ce89800cb1cc2d50e0cde9936cb7ec1b0b6c4a8) Signed-off-by: Andras Timar <andras.ti...@collabora.com> This code conditional to presentations only Change-Id: If7caef1ec78e26960a4dd91edd3c798190d2fdc4 (cherry picked from commit 6c4472de1d056bdb1a5463d7402e006ecec6880f) Signed-off-by: Andras Timar <andras.ti...@collabora.com> diff --git a/loleaflet/dist/toolbar/toolbar.js b/loleaflet/dist/toolbar/toolbar.js index 692b39b..f78ce9c 100644 --- a/loleaflet/dist/toolbar/toolbar.js +++ b/loleaflet/dist/toolbar/toolbar.js @@ -414,6 +414,25 @@ $(function () { $('#backColorPicker').on('change.color', onColorPick); } + if (map.getDocType() === 'presentation') { + // Fill the style select box if not yet filled + if ($('.styles-select')[0] && $('.styles-select')[0].length === 0) { + var data = ['']; + // Inserts a separator element + data = data.concat({text: '\u2500\u2500\u2500\u2500\u2500\u2500', disabled: true}); + + L.Styles.impressLayout.forEach(function(layout) { + data = data.concat({id: layout.id, text: _(layout.text)}); + }, this); + + $('.styles-select').select2({ + data: data, + placeholder: _('Layout') + }); + $('.styles-select').on('select2:select', onStyleSelect); + } + } + insertTable(); } }); @@ -1309,26 +1328,6 @@ map.on('updatepermission', function (e) { } }); -map.on('statusindicator', function (e) { - if (e.statusType === 'loleafletloaded') { - var data = ['']; - if (map.getDocType() === 'presentation') { - // Inserts a separator element - data = data.concat({text: '\u2500\u2500\u2500\u2500\u2500\u2500', disabled: true}); - - L.Styles.impressLayout.forEach(function(layout) { - data = data.concat({id: layout.id, text: _(layout.text)}); - }, this); - - $('.styles-select').select2({ - data: data, - placeholder: _('Layout') - }); - $('.styles-select').on('select2:select', onStyleSelect); - } - } -}); - map.on('keydown', function (e) { if (e.originalEvent.ctrlKey && !e.originalEvent.altKey && (e.originalEvent.key === 'f' || e.originalEvent.key === 'F')) { _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits