From 1cf5bde981941f2ac2920819e93fb55a7ca3bac1 Mon Sep 17 00:00:00 2001 From: Michael Meeks Date: Mon, 13 Jan 2020 17:57:22 +0000 Subject: [PATCH] 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 Reviewed-by: Michael Meeks --- loleaflet/src/control/Control.Toolbar.js | 25 ++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/loleaflet/src/control/Control.Toolbar.js b/loleaflet/src/control/Control.Toolbar.js index 0d1daef7b..0074e9585 100644 --- a/loleaflet/src/control/Control.Toolbar.js +++ b/loleaflet/src/control/Control.Toolbar.js @@ -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);