only show text background color picker if text tool is active

This commit is contained in:
raphael 2021-02-23 15:04:47 +01:00
parent 2868d27288
commit 5bf39fe008
2 changed files with 14 additions and 1 deletions

View File

@ -134,7 +134,11 @@
<button tool="text" title="write text" type="button" class="whiteboard-tool">
<i class="fas fa-font"></i>
</button>
<button title="text background-color">
<button
id="textboxBackgroundColorPickerBtn"
style="display: none"
title="text background-color"
>
<div
id="textboxBackgroundColorPicker"
style="
@ -142,6 +146,9 @@
height: 23px;
border-radius: 3px;
border: 1px solid darkgrey;
left: -4px;
top: -2px;
position: relative;
"
data-color="#f5f587"
></div>

View File

@ -304,6 +304,12 @@ function initWhiteboard() {
} else {
$(".activeToolIcon").html($(this).html()); //Set Active icon the same as the button icon
}
if (activeTool == "text") {
$("#textboxBackgroundColorPickerBtn").show();
} else {
$("#textboxBackgroundColorPickerBtn").hide();
}
});
// upload image button