File tree Expand file tree Collapse file tree 2 files changed +14
-9
lines changed Expand file tree Collapse file tree 2 files changed +14
-9
lines changed Original file line number Diff line number Diff line change @@ -16,10 +16,12 @@ if (!isEmbedded) {
16
16
if ( versionNodes . length > 0 || ! versionsContainer ) {
17
17
// Initially the container contains only text with the current version
18
18
const currentVersion = versionsContainer . textContent . trim ( )
19
+
19
20
// Add the current version node to the list if not there.
20
21
const withCurrentVersion = versionNodes . some ( ( node ) => node . version === currentVersion )
21
22
? versionNodes
22
23
: [ { version : currentVersion , url : '#' } , ...versionNodes ]
24
+
23
25
// Add additional attributes to version nodes for rendering.
24
26
const nodes = withCurrentVersion . map ( node => ( {
25
27
...node ,
@@ -36,7 +38,10 @@ if (!isEmbedded) {
36
38
adjustWidth ( select )
37
39
38
40
const versionsGoToLatest = qs ( '.sidebar-staleVersion a' )
39
- versionsGoToLatest . addEventListener ( 'click' , handleGoToLatestClicked )
41
+
42
+ if ( versionsGoToLatest ) {
43
+ versionsGoToLatest . addEventListener ( 'click' , handleGoToLatestClicked )
44
+ }
40
45
}
41
46
}
42
47
You can’t perform that action at this time.
0 commit comments