File tree Expand file tree Collapse file tree 2 files changed +9
-11
lines changed
Expand file tree Collapse file tree 2 files changed +9
-11
lines changed Original file line number Diff line number Diff line change @@ -69,15 +69,15 @@ const BUTTON_ROWS = [
6969 [ "forum" , "issue tracker" , "chat" , "email" ]
7070] ;
7171
72- function urlButton ( type , url ) {
72+ function urlButton ( type , url , btnClass ) {
7373 const button = document . createElement ( "button" ) ;
7474 let iconFile = BUTTON_ICONS [ type ] ;
7575 button . type = "button"
76- button . classList . add ( 'btn' , 'btn-sm' , ' m-1') ;
76+ button . classList . add ( 'btn' , 'm-1' ) ;
7777 let icon = `<img aria-hidden='true' focusable='false' class='icon' src='assets/${ iconFile } '></img>` ;
7878 button . innerHTML = icon + " " + type ;
7979 if ( url !== undefined ) {
80- button . classList . add ( 'btn-info' ) ;
80+ button . classList . add ( btnClass ) ;
8181 button . onclick = function ( ) {
8282 window . open ( url , "_blank" ) ;
8383 }
Original file line number Diff line number Diff line change @@ -103,19 +103,17 @@ function showDetails(data, connected) {
103103 link_heading . innerHTML = "Links" ;
104104 let tool_links = data [ "urls" ] ;
105105 details_bottom . appendChild ( link_heading ) ;
106+ const flex_div = document . createElement ( "div" ) ;
107+ flex_div . classList . add ( "d-flex" , "flex-wrap" ) ;
108+ const btnClasses = [ "btn-primary" , "btn-success" , "btn-warning" ] ;
106109 for ( let row_idx = 0 ; row_idx < BUTTON_ROWS . length ; row_idx ++ ) {
107- let row = document . createElement ( "div" ) ;
108- row . classList . add ( "row" ) ;
109110 // Go through elements in BUTTON_ROWS
110111 for ( const button_type of BUTTON_ROWS [ row_idx ] ) {
111- let col = document . createElement ( "div" ) ;
112- col . classList . add ( "col-auto" ) ;
113- let button = urlButton ( button_type , tool_links [ button_type ] ) ;
114- col . appendChild ( button ) ;
115- row . appendChild ( col ) ;
112+ let button = urlButton ( button_type , tool_links [ button_type ] , btnClasses [ row_idx ] ) ;
113+ flex_div . appendChild ( button ) ;
116114 }
117- details_bottom . appendChild ( row ) ;
118115 }
116+ details_bottom . appendChild ( flex_div ) ;
119117 }
120118 // hide filter pane
121119 const filterPane = new bootstrap . Offcanvas ( '#filter_pane' ) ;
You can’t perform that action at this time.
0 commit comments