Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 10afd82

Browse files
author
xuxinhua
committed
源码链接,新窗口打开
1 parent 3ff1244 commit 10afd82

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

websites/code/studygolang/template/pkgdoc.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,14 @@
3636

3737
iframe.height = iframe.contentDocument.body.offsetHeight + addHeight;
3838
}
39+
40+
// 源码链接,新窗口打开
41+
$('#pkgdoc').contents().find('a').on('mousedown', function(evt){
42+
var url = $(this).attr('href');
43+
if (url.indexOf('github.com') > 0) {
44+
$(this).attr('target', '_blank');
45+
}
46+
});
3947
}
4048
</script>
4149
{{end}}

0 commit comments

Comments
 (0)