File tree 1 file changed +8
-5
lines changed
1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -180,15 +180,18 @@ window.loadTryExamplesConfig = async (configFilePath) => {
180
180
tryExamplesGlobalMinHeight = parseInt ( data . global_min_height ) ;
181
181
}
182
182
183
- // Disable interactive examples if file matches one of the ignore patterns
184
- // by hiding try_examples_buttons.
183
+ // Selectively enable interactive examples if file matches one of the ignore patterns
184
+ // by un- hiding try_examples_buttons.
185
185
Patterns = data . ignore_patterns ;
186
186
for ( let pattern of Patterns ) {
187
187
let regex = new RegExp ( pattern ) ;
188
- if ( regex . test ( currentPageUrl ) ) {
189
- var buttons = document . getElementsByClassName ( "try_examples_button" ) ;
188
+ if ( ! regex . test ( currentPageUrl ) ) {
189
+ var buttons = document . getElementsByClassName (
190
+ "try_examples_button hidden" ,
191
+ ) ;
190
192
for ( var i = 0 ; i < buttons . length ; i ++ ) {
191
- buttons [ i ] . classList . add ( "hidden" ) ;
193
+ console . log ( buttons [ i ] ) ;
194
+ buttons [ i ] . classList . remove ( "hidden" ) ;
192
195
}
193
196
break ;
194
197
}
You can’t perform that action at this time.
0 commit comments