Skip to content

Commit 6524132

Browse files
authored
Merge pull request git-for-windows#77 from dscho/really-no-more-jquery
Really avoid any jQuery construct
2 parents ec275b8 + bbbcf70 commit 6524132

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

layouts/_default/baseof.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,9 @@
3434
{{ if eq "home" .Kind -}}
3535
/* Replace the download link if a Windows browser was detected */
3636
try {
37-
var href = $('.version > a')[0].href.match(/^(.*\/)tag(\/.*)$/);
38-
var version = $('.version > a')[0].title.match(/^Version ([0-9.]*)(\(([0-9]*)?\))?/);
37+
var a = document.querySelector('.version > a')
38+
var href = a?.href.match(/^(.*\/)tag(\/.*)$/);
39+
var version = a?.title.match(/^Version ([0-9.]*)(\(([0-9]*)?\))?/);
3940
if (!href || !version || !navigator.userAgentData)
4041
throw 0;
4142

0 commit comments

Comments
 (0)