Fix blame page select range error and some typos (#19503)
Partially back port from #19500 and fix two typos.
This commit is contained in:
parent
242f7f1a52
commit
b31418edd9
3 changed files with 5 additions and 6 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue