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 525525 </ div >
526526
527527 < div class ="mb-4 ml-1 ">
528- < button id ="btn-load-epss-chart " class ="button is-small is-info is-outlined mr-2 ">
528+ < button id ="btn-load-epss-chart " class ="button is-small is-info mr-2 ">
529529 See Trend
530530 </ button >
531- < button id ="btn-load-epss-table " class ="button is-small is-info is-outlined ">
531+ < button id ="btn-load-epss-table " class ="button is-small is-info ">
532532 See Table
533533 </ button >
534534 </ 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