1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-21 17:58:35 +00:00

Fix blame page select range error and some typos (#19503)

Partially back port from #19500 and fix two typos.
This commit is contained in:
Lunny Xiao
2022-04-27 03:19:52 +08:00
committed by GitHub
parent 242f7f1a52
commit b31418edd9
3 changed files with 5 additions and 6 deletions

View File

@@ -15,10 +15,6 @@ function selectRange($list, $select, $from) {
const $issue = $('a.ref-in-new-issue');
const $copyPermalink = $('a.copy-line-permalink');
if ($copyPermalink.length === 0) {
return;
}
const updateIssueHref = function (anchor) {
if ($issue.length === 0) {
return;
@@ -29,6 +25,9 @@ function selectRange($list, $select, $from) {
};
const updateCopyPermalinkHref = function(anchor) {
if ($copyPermalink.length === 0) {
return;
}
let link = $copyPermalink.attr('data-clipboard-text');
link = `${link.replace(/#L\d+$|#L\d+-L\d+$/, '')}#${anchor}`;
$copyPermalink.attr('data-clipboard-text', link);