File tree Expand file tree Collapse file tree
vulnerabilities/templates Expand file tree Collapse file tree Original file line number Diff line number Diff line change 505505 </ div >
506506
507507 < div class ="mb-4 ml-1 ">
508- < button id ="btn-load-epss-chart " class ="button is-small is-info is-outlined mr-2 ">
508+ < button id ="btn-load-epss-chart " class ="button is-small is-info mr-2 ">
509509 See Trend
510510 </ button >
511- < button id ="btn-load-epss-table " class ="button is-small is-info is-outlined ">
511+ < button id ="btn-load-epss-table " class ="button is-small is-info ">
512512 See Table
513513 </ button >
514514 </ div >
Original file line number Diff line number Diff line change 88 const getHistoryData = ( ) => JSON . parse ( document . getElementById ( 'epss-history-data' ) ?. textContent || "[]" ) ;
99 const toggleDisplay = ( el ) => el . style . display = el . style . display === "none" ? "block" : "none" ;
1010
11+ const updateBtn = ( btn , wrap ) => {
12+ if ( ! btn || ! wrap ) return ;
13+ const isHidden = wrap . style . display === "none" ;
14+ btn . textContent = btn . textContent . replace ( isHidden ? "Hide" : "See" , isHidden ? "See" : "Hide" ) ;
15+ } ;
16+
1117 function renderChart ( ) {
1218 const data = getHistoryData ( ) ;
1319 if ( ! data . length ) return ;
1420
1521 toggleDisplay ( chartWrap ) ;
22+ updateBtn ( btnChart , chartWrap ) ;
23+
1624 if ( chartWrap . style . display === "none" || epssChartInstance ) return ;
1725
1826 const history = [ ] ;
6270 }
6371
6472 btnChart ?. addEventListener ( "click" , renderChart ) ;
65- btnTable ?. addEventListener ( "click" , ( ) => toggleDisplay ( tableWrap ) ) ;
73+ btnTable ?. addEventListener ( "click" , ( ) => {
74+ toggleDisplay ( tableWrap ) ;
75+ updateBtn ( btnTable , tableWrap ) ;
76+ } ) ;
77+
78+ updateBtn ( btnChart , chartWrap ) ;
79+ updateBtn ( btnTable , tableWrap ) ;
6680} ) ( ) ;
You can’t perform that action at this time.
0 commit comments