Skip to content

Commit

Permalink
elyra-ai#2209 Regression - Additional CSS formats for comment borders…
Browse files Browse the repository at this point in the history
… are not… (elyra-ai#2210)

Signed-off-by: CTomlyn <[email protected]>
  • Loading branch information
tomlyn authored Oct 15, 2024
1 parent 958067f commit 7b8b5ad
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1362,25 +1362,27 @@ export default class CanvasUtils {
return (luma < 108);
}

// Applies the outlineStyle format to the D3 comment selection passed in,
// if one exists, in the formats array passed in.
// Applies the outlineStyle format or border-xxx CSS styles to the D3 comment
// selection passed in, if one exists, in the formats array passed in.
static applyOutlineStyle(commentSel, formats) {
if (formats?.length > 0) {
formats.forEach((f) => {
if (f.type === "outlineStyle") { // Only apply outline style to outer <div>
if (f.type === "outlineStyle" ||
f.type.startsWith("border")) { // Only apply outline and border style to outer <div>
const { field, value } = CanvasUtils.convertFormat(f);
commentSel.style(field, value);
}
});
}
}

// Applies all formats from the formats array, that are not outlineStyle, to the
// D3 comment selection passed in.
// Applies all formats from the formats array, that are not outlineStyle or
// border-xxx CSS styles, to the D3 comment selection passed in.
static applyNonOutlineStyle(commentSel, formats) {
if (formats?.length > 0) {
formats.forEach((f) => {
if (f.type !== "outlineStyle") { // Only apply outline style to outer <div>
if (f.type !== "outlineStyle" &&
!f.type.startsWith("border")) { // Only apply outline and border style to outer <div>
const { field, value } = CanvasUtils.convertFormat(f);
commentSel.style(field, value);
}
Expand Down

0 comments on commit 7b8b5ad

Please sign in to comment.