mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	fix #15718 Signed-off-by: a1012112796 <1012112796@qq.com> Co-authored-by: a1012112796 <1012112796@qq.com>
This commit is contained in:
		@@ -111,15 +111,17 @@
 | 
				
			|||||||
						{{end}}
 | 
											{{end}}
 | 
				
			||||||
					</tbody>
 | 
										</tbody>
 | 
				
			||||||
				</table>
 | 
									</table>
 | 
				
			||||||
				<div class="code-view-menu-list ui fluid popup transition hidden">
 | 
										{{if $.Permission.CanRead $.UnitTypeIssues}}
 | 
				
			||||||
					<div class="ui column relaxed equal height">
 | 
											<div class="code-view-menu-list ui fluid popup transition hidden">
 | 
				
			||||||
						<div class="column">
 | 
												<div class="ui column relaxed equal height">
 | 
				
			||||||
							<div class="ui link list">
 | 
													<div class="column">
 | 
				
			||||||
								<a class="item ref-in-new-issue" href="{{.RepoLink}}/issues/new?body={{URLJoin AppUrl .RepoLink}}/src/commit/{{.CommitID}}/{{EscapePound .TreePath}}">{{.i18n.Tr "repo.issues.context.reference_issue"}}</a>
 | 
														<div class="ui link list">
 | 
				
			||||||
 | 
															<a class="item ref-in-new-issue" href="{{.RepoLink}}/issues/new?body={{URLJoin AppUrl .RepoLink}}/src/commit/{{.CommitID}}/{{EscapePound .TreePath}}">{{.i18n.Tr "repo.issues.context.reference_issue"}}</a>
 | 
				
			||||||
 | 
														</div>
 | 
				
			||||||
 | 
													</div>
 | 
				
			||||||
							</div>
 | 
												</div>
 | 
				
			||||||
						</div>
 | 
											</div>
 | 
				
			||||||
					</div>
 | 
										{{end}}
 | 
				
			||||||
				</div>
 | 
					 | 
				
			||||||
				{{end}}
 | 
									{{end}}
 | 
				
			||||||
			{{end}}
 | 
								{{end}}
 | 
				
			||||||
		</div>
 | 
							</div>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -2180,6 +2180,10 @@ function searchRepositories() {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function showCodeViewMenu() {
 | 
					function showCodeViewMenu() {
 | 
				
			||||||
 | 
					  if ($('.code-view-menu-list').length === 0) {
 | 
				
			||||||
 | 
					    return;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // Get clicked tr
 | 
					  // Get clicked tr
 | 
				
			||||||
  const $code_tr = $('.code-view td.lines-code.active').parent();
 | 
					  const $code_tr = $('.code-view td.lines-code.active').parent();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -2834,6 +2838,11 @@ function selectRange($list, $select, $from) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
      // add hashchange to permalink
 | 
					      // add hashchange to permalink
 | 
				
			||||||
      const $issue = $('a.ref-in-new-issue');
 | 
					      const $issue = $('a.ref-in-new-issue');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      if ($issue.length === 0) {
 | 
				
			||||||
 | 
					        return;
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      const matched = $issue.attr('href').match(/%23L\d+$|%23L\d+-L\d+$/);
 | 
					      const matched = $issue.attr('href').match(/%23L\d+$|%23L\d+-L\d+$/);
 | 
				
			||||||
      if (matched) {
 | 
					      if (matched) {
 | 
				
			||||||
        $issue.attr('href', $issue.attr('href').replace($issue.attr('href').substr(matched.index), `%23L${a}-L${b}`));
 | 
					        $issue.attr('href', $issue.attr('href').replace($issue.attr('href').substr(matched.index), `%23L${a}-L${b}`));
 | 
				
			||||||
@@ -2849,6 +2858,11 @@ function selectRange($list, $select, $from) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  // add hashchange to permalink
 | 
					  // add hashchange to permalink
 | 
				
			||||||
  const $issue = $('a.ref-in-new-issue');
 | 
					  const $issue = $('a.ref-in-new-issue');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  if ($issue.length === 0) {
 | 
				
			||||||
 | 
					    return;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  const matched = $issue.attr('href').match(/%23L\d+$|%23L\d+-L\d+$/);
 | 
					  const matched = $issue.attr('href').match(/%23L\d+$|%23L\d+-L\d+$/);
 | 
				
			||||||
  if (matched) {
 | 
					  if (matched) {
 | 
				
			||||||
    $issue.attr('href', $issue.attr('href').replace($issue.attr('href').substr(matched.index), `%23${$select.attr('rel')}`));
 | 
					    $issue.attr('href', $issue.attr('href').replace($issue.attr('href').substr(matched.index), `%23${$select.attr('rel')}`));
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user