Skip to content

Commit

Permalink
Merge pull request #559 from paulwarren-wk/transparent-concealed-facts
Browse files Browse the repository at this point in the history
  • Loading branch information
austinmatherne-wk authored Sep 7, 2023
2 parents 5b17688 + 2a46728 commit 94d5779
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
4 changes: 3 additions & 1 deletion iXBRLViewerPlugin/viewer/src/js/ixnode.js
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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')));
}
}
11 changes: 11 additions & 0 deletions iXBRLViewerPlugin/viewer/src/js/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

0 comments on commit 94d5779

Please sign in to comment.