diff --git a/iXBRLViewerPlugin/viewer/src/js/ixnode.js b/iXBRLViewerPlugin/viewer/src/js/ixnode.js index 5985eabee..41a81c6ee 100644 --- a/iXBRLViewerPlugin/viewer/src/js/ixnode.js +++ b/iXBRLViewerPlugin/viewer/src/js/ixnode.js @@ -1,5 +1,7 @@ // See COPYRIGHT.md for copyright information +import $ from 'jquery'; +import { isTransparent } from './util.js'; /* * Object to hold information related to iXBRL nodes in the HTML document. @@ -44,6 +46,6 @@ export class IXNode { } htmlHidden() { - return this.wrapperNodes.is(':hidden'); + return this.wrapperNodes.is(':hidden') || this.wrapperNodes.is((i,e) => isTransparent($(e).css('color'))); } } diff --git a/iXBRLViewerPlugin/viewer/src/js/util.js b/iXBRLViewerPlugin/viewer/src/js/util.js index 4e4c49546..c571b590d 100644 --- a/iXBRLViewerPlugin/viewer/src/js/util.js +++ b/iXBRLViewerPlugin/viewer/src/js/util.js @@ -149,3 +149,14 @@ export function titleCase(text) { .join(''); }).join(' '); } + +/** + * Extract the alpha value from an rgba(r,g,b,a) string and returns true if + * transparent (a < 10%). Returns false on rgb(r,g,b) strings. + * @param {String} rgba color string to parse + * @return {Boolean} whether the value is transparent + */ +export function isTransparent(rgba) { + const val = parseFloat(rgba.split(",")[3]); + return !isNaN(val) && val < 0.1; +}