Skip to content

Commit

Permalink
content/static/js: remove guessKind
Browse files Browse the repository at this point in the history
Fixes golang/go#42957

Change-Id: I273ed33ae2c9a57632a9870864bc962e2e0d4b8c
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/274953
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
  • Loading branch information
jba committed Dec 3, 2020
1 parent 97be6d0 commit adf682b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 32 deletions.
29 changes: 0 additions & 29 deletions content/static/js/jump.js
Expand Up @@ -92,9 +92,6 @@ function newJumpListItem(el) {
a.setAttribute('href', '#' + name);
a.setAttribute('tabindex', '-1');
let kind = el.getAttribute('data-kind');
if (!kind) {
kind = guessKind(el);
}
return {
link: a,
name: name,
Expand All @@ -103,32 +100,6 @@ function newJumpListItem(el) {
};
}

// guessKind tries to guess the kind of el by looking around the DOM.
// TODO(https://golang.org/issue/42957): remove.
function guessKind(el) {
switch (el.getAttribute('class')) {
case 'Documentation-functionHeader':
case 'Documentation-typeFuncHeader':
return 'function';
case 'Documentation-typeHeader':
return 'type';
case 'Documentation-typeMethodHeader':
return 'method';
default:
const sec = el.closest('section');
switch (sec.getAttribute('class')) {
case 'Documentation-variables':
return 'variable';
case 'Documentation-constants':
return 'constant';
case 'Documentation-types':
return 'field';
default:
return '';
}
}
}

let lastFilterValue; // The last contents of the filter text box.
let activeJumpItem = -1; // The index of the currently active item in the list.

Expand Down
5 changes: 2 additions & 3 deletions content/static/js/jump.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit adf682b

Please sign in to comment.