Toolbar color buttons should track transparent state as well as colors.

Change-Id: I727ff4f942b7059da4f17216fe523dd1bbb04cd2
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/86710
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
This commit is contained in:
Michael Meeks 2020-01-13 17:57:22 +00:00
parent f5d159b80b
commit 1cf5bde981

View file

@ -1818,13 +1818,13 @@ function onCommandStateChanged(e) {
color = 'transparent';
}
else {
color = color.toString(16);
color = '#' + Array(7 - color.length).join('0') + color;
$('#tb_editbar_item_fontcolor .w2ui-tb-image').css('box-shadow', 'inset 0 -2px #ffffff, inset 0px -6px ' + color);
$('#tb_editbar_item_fontcolor .w2ui-tb-down').css('display', 'none');
$('#tb_editbar_item_fontcolor .w2ui-tb-caption').css('display', 'none');
}
$('#tb_editbar_item_fontcolor .w2ui-tb-image').css('box-shadow', 'inset 0 -2px #ffffff, inset 0px -6px ' + color);
$('#tb_editbar_item_fontcolor .w2ui-tb-down').css('display', 'none');
$('#tb_editbar_item_fontcolor .w2ui-tb-caption').css('display', 'none');
div = L.DomUtil.get('fontcolorindicator');
if (div) {
L.DomUtil.setStyle(div, 'background', color);
@ -1839,15 +1839,16 @@ function onCommandStateChanged(e) {
else {
color = color.toString(16);
color = '#' + Array(7 - color.length).join('0') + color;
//writer
$('#tb_editbar_item_backcolor .w2ui-tb-image').css('box-shadow', 'inset 0 -2px #ffffff, inset 0px -6px ' + color);
$('#tb_editbar_item_backcolor .w2ui-tb-down').css('display', 'none');
$('#tb_editbar_item_backcolor .w2ui-tb-caption').css('display', 'none');
//calc?
$('#tb_editbar_item_backgroundcolor .w2ui-tb-image').css('box-shadow', 'inset 0 -2px #ffffff, inset 0px -6px ' + color);
$('#tb_editbar_item_backgroundcolor .w2ui-tb-down').css('display', 'none');
$('#tb_editbar_item_backgroundcolor .w2ui-tb-caption').css('display', 'none');
}
//writer
$('#tb_editbar_item_backcolor .w2ui-tb-image').css('box-shadow', 'inset 0 -2px #ffffff, inset 0px -6px ' + color);
$('#tb_editbar_item_backcolor .w2ui-tb-down').css('display', 'none');
$('#tb_editbar_item_backcolor .w2ui-tb-caption').css('display', 'none');
//calc?
$('#tb_editbar_item_backgroundcolor .w2ui-tb-image').css('box-shadow', 'inset 0 -2px #ffffff, inset 0px -6px ' + color);
$('#tb_editbar_item_backgroundcolor .w2ui-tb-down').css('display', 'none');
$('#tb_editbar_item_backgroundcolor .w2ui-tb-caption').css('display', 'none');
div = L.DomUtil.get('backcolorindicator');
if (div) {
L.DomUtil.setStyle(div, 'background', color);