loleaflet/dist/toolbar/toolbar.js | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-)
New commits: commit 22b676f088b558d3ea79b14863755a931bd7c919 Author: Pranav Kant <pran...@collabora.co.uk> Date: Fri Jan 6 14:42:27 2017 +0530 loleaflet: Make id of these toolbar items consistent with others We assume that id of the toolbar item is lowercase(unocommand), so lets keep it consistent too for alignment buttons. This also makes alignment buttons toggle except for spreadsheet where alignment of cell text happens via a different uno command, HorizontalAlignment. Change-Id: Ibacf06bd99435cd24b27c7870173a2519b167af1 Reviewed-on: https://gerrit.libreoffice.org/32774 Reviewed-by: pranavk <pran...@collabora.co.uk> Tested-by: pranavk <pran...@collabora.co.uk> diff --git a/loleaflet/dist/toolbar/toolbar.js b/loleaflet/dist/toolbar/toolbar.js index 3ef80bd..4263580 100644 --- a/loleaflet/dist/toolbar/toolbar.js +++ b/loleaflet/dist/toolbar/toolbar.js @@ -383,10 +383,10 @@ $(function () { {type: 'html', id: 'backcolor-html', html: '<input id="backColorPicker" style="display:none;">'}, {type: 'button', id: 'backcolor', img: 'backcolor', hint: _('Highlighting')}, {type: 'break'}, - {type: 'button', id: 'alignleft', img: 'alignleft', hint: _('Align left'), uno: 'LeftPara', unosheet: 'HorizontalAlignment {"HorizontalAlignment":{"type":"unsigned short", "value":"1"}}'}, - {type: 'button', id: 'alignhorizontal', img: 'alignhorizontal', hint: _('Center horizontally'), uno: 'CenterPara', unosheet: 'HorizontalAlignment {"HorizontalAlignment":{"type":"unsigned short", "value":"2"}}'}, - {type: 'button', id: 'alignright', img: 'alignright', hint: _('Align right'), uno: 'RightPara', unosheet: 'HorizontalAlignment {"HorizontalAlignment":{"type":"unsigned short", "value":"3"}}'}, - {type: 'button', id: 'alignblock', img: 'alignblock', hint: _('Justified'), uno: 'JustifyPara', unosheet: 'HorizontalAlignment {"HorizontalAlignment":{"type":"unsigned short", "value":"4"}}'}, + {type: 'button', id: 'leftpara', img: 'alignleft', hint: _('Align left'), uno: 'LeftPara', unosheet: 'HorizontalAlignment {"HorizontalAlignment":{"type":"unsigned short", "value":"1"}}'}, + {type: 'button', id: 'centerpara', img: 'alignhorizontal', hint: _('Center horizontally'), uno: 'CenterPara', unosheet: 'HorizontalAlignment {"HorizontalAlignment":{"type":"unsigned short", "value":"2"}}'}, + {type: 'button', id: 'rightpara', img: 'alignright', hint: _('Align right'), uno: 'RightPara', unosheet: 'HorizontalAlignment {"HorizontalAlignment":{"type":"unsigned short", "value":"3"}}'}, + {type: 'button', id: 'justifypara', img: 'alignblock', hint: _('Justified'), uno: 'JustifyPara', unosheet: 'HorizontalAlignment {"HorizontalAlignment":{"type":"unsigned short", "value":"4"}}'}, {type: 'break', id: 'wraptextseparator'}, {type: 'button', id: 'wraptext', img: 'wraptext', hint: _('Wrap Text'), uno: 'WrapText'}, {type: 'button', id: 'togglemergecells', img: 'togglemergecells', hint: _('Merge and Center Cells'), uno: 'ToggleMergeCells'}, @@ -606,6 +606,11 @@ function toLocalePattern (pattern, regex, text, sub1, sub2) { return text; } +function unoCmdToToolbarId(commandname) +{ + return commandname.toLowerCase().substr(5); +} + function selectItem(item, func) { var index = -1; @@ -898,6 +903,7 @@ map.on('commandstatechanged', function (e) { var found = false; var value, color, div; var matches; + if (commandName === '.uno:AssignLayout') { $('.styles-select').val(state).trigger('change'); } else if (commandName === '.uno:StyleApply') { @@ -1041,7 +1047,7 @@ map.on('commandstatechanged', function (e) { $('#PageStatus').html(state ? state : '  '); } - var id = commandName.toLowerCase().substr(5); + var id = unoCmdToToolbarId(commandName); if (typeof formatButtons[id] !== 'undefined') { if (state === 'true') { toolbar.enable(id); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits