File tree Expand file tree Collapse file tree 1 file changed +5
-16
lines changed Expand file tree Collapse file tree 1 file changed +5
-16
lines changed Original file line number Diff line number Diff line change @@ -145,29 +145,18 @@ function highlightIfNeeded(elem) {
145
145
} ) ;
146
146
}
147
147
148
- function expandLintId ( lintId ) {
149
- searchState . inputElem . value = lintId ;
150
- searchState . filterLints ( ) ;
151
-
152
- // Expand the lint.
148
+ function expandLint ( lintId ) {
153
149
const lintElem = document . getElementById ( lintId ) ;
154
- const isCollapsed = lintElem . classList . remove ( "collapsed" ) ;
155
- lintElem . querySelector ( ".label-doc-folding" ) . innerText = "- ";
150
+ const isCollapsed = lintElem . classList . toggle ( "collapsed" ) ;
151
+ lintElem . querySelector ( ".label-doc-folding" ) . innerText = isCollapsed ? "+" : "− ";
156
152
highlightIfNeeded ( lintElem ) ;
157
153
}
158
154
159
155
// Show details for one lint
160
156
function openLint ( event ) {
161
157
event . preventDefault ( ) ;
162
158
event . stopPropagation ( ) ;
163
- expandLintId ( event . target . getAttribute ( "href" ) . slice ( 1 ) ) ;
164
- }
165
-
166
- function expandLint ( lintId ) {
167
- const lintElem = document . getElementById ( lintId ) ;
168
- const isCollapsed = lintElem . classList . toggle ( "collapsed" ) ;
169
- lintElem . querySelector ( ".label-doc-folding" ) . innerText = isCollapsed ? "+" : "-" ;
170
- highlightIfNeeded ( lintElem ) ;
159
+ expandLint ( event . target . getAttribute ( "href" ) . slice ( 1 ) ) ;
171
160
}
172
161
173
162
function copyToClipboard ( event ) {
@@ -526,7 +515,7 @@ function scrollToLint(lintId) {
526
515
return ;
527
516
}
528
517
target . scrollIntoView ( ) ;
529
- expandLintId ( lintId ) ;
518
+ expandLint ( lintId ) ;
530
519
}
531
520
532
521
// If the page we arrive on has link to a given lint, we scroll to it.
You can’t perform that action at this time.
0 commit comments