File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -135,9 +135,24 @@ function initCopyButtons() {
135135}
136136
137137
138+ // Card inner subtabs (Install / Remove)
139+ function initSubtabs ( ) {
140+ document . querySelectorAll ( '.card-subtab' ) . forEach ( function ( btn ) {
141+ btn . addEventListener ( 'click' , function ( ) {
142+ var card = btn . closest ( '.card' ) ;
143+ var subtab = btn . getAttribute ( 'data-subtab' ) ;
144+ card . querySelectorAll ( '.card-subtab' ) . forEach ( function ( b ) { b . classList . remove ( 'active' ) ; } ) ;
145+ btn . classList . add ( 'active' ) ;
146+ card . querySelectorAll ( '.subtab-panel' ) . forEach ( function ( p ) { p . classList . remove ( 'active' ) ; } ) ;
147+ card . querySelector ( '.subtab-panel[data-subtab="' + subtab + '"]' ) . classList . add ( 'active' ) ;
148+ } ) ;
149+ } ) ;
150+ }
151+
138152// Initialize when page loads
139153document . addEventListener ( 'DOMContentLoaded' , function ( ) {
140154 initTabs ( ) ;
155+ initSubtabs ( ) ;
141156 fetchLatestRelease ( ) ;
142157 initCopyButtons ( ) ;
143158} ) ;
You can’t perform that action at this time.
0 commit comments