File tree 1 file changed +12
-9
lines changed
1 file changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,8 @@ document.getElementById('filter-input').addEventListener('keyup', function(e) {
30
30
31
31
if ( ! value . match ( / ^ \s * $ / ) ) {
32
32
match = function ( element ) {
33
- return element . firstChild . innerHTML . toLowerCase ( ) . indexOf ( value ) !== - 1 ;
33
+ var html = element . firstChild . innerHTML ;
34
+ return html && html . toLowerCase ( ) . indexOf ( value ) !== - 1 ;
34
35
} ;
35
36
}
36
37
@@ -83,14 +84,16 @@ function toggleSibling() {
83
84
}
84
85
85
86
function showHashTarget ( targetId ) {
86
- var hashTarget = document . getElementById ( targetId ) ;
87
- // new target is hidden
88
- if (
89
- hashTarget &&
90
- hashTarget . offsetHeight === 0 &&
91
- hashTarget . parentNode . parentNode . classList . contains ( 'display-none' )
92
- ) {
93
- hashTarget . parentNode . parentNode . classList . remove ( 'display-none' ) ;
87
+ if ( targetId ) {
88
+ var hashTarget = document . getElementById ( targetId ) ;
89
+ // new target is hidden
90
+ if (
91
+ hashTarget &&
92
+ hashTarget . offsetHeight === 0 &&
93
+ hashTarget . parentNode . parentNode . classList . contains ( 'display-none' )
94
+ ) {
95
+ hashTarget . parentNode . parentNode . classList . remove ( 'display-none' ) ;
96
+ }
94
97
}
95
98
}
96
99
You can’t perform that action at this time.
0 commit comments