aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoryp05327 <576951401@qq.com>2024-12-04 01:52:25 +0900
committerGitHub <noreply@github.com>2024-12-03 16:52:25 +0000
commit690d07470cab795d64153c77405aba7dc5814a9e (patch)
tree2032aad27ac26608909829c2fe4fb50989fb4e13
parent136408307c6de7aac2ab5476f8cddf90f39355dc (diff)
downloadgitea-690d07470cab795d64153c77405aba7dc5814a9e.tar.gz
gitea-690d07470cab795d64153c77405aba7dc5814a9e.zip
Fix word overflow in file search page (#32695)
-rw-r--r--templates/repo/find/files.tmpl2
-rw-r--r--web_src/js/features/repo-findfile.ts1
2 files changed, 2 insertions, 1 deletions
diff --git a/templates/repo/find/files.tmpl b/templates/repo/find/files.tmpl
index 548ce2f0e8..ce242796be 100644
--- a/templates/repo/find/files.tmpl
+++ b/templates/repo/find/files.tmpl
@@ -9,7 +9,7 @@
<input id="repo-file-find-input" type="text" autofocus data-url-data-link="{{.DataLink}}" data-url-tree-link="{{.TreeLink}}">
</div>
</div>
- <table id="repo-find-file-table" class="ui single line table">
+ <table id="repo-find-file-table" class="ui single line fixed table">
<tbody>
</tbody>
</table>
diff --git a/web_src/js/features/repo-findfile.ts b/web_src/js/features/repo-findfile.ts
index 1f151d7056..6500978bc8 100644
--- a/web_src/js/features/repo-findfile.ts
+++ b/web_src/js/features/repo-findfile.ts
@@ -90,6 +90,7 @@ function filterRepoFiles(filter) {
const span = document.createElement('span');
// safely escape by using textContent
span.textContent = part;
+ span.title = span.textContent;
// if the target file path is "abc/xyz", to search "bx", then the matchResult is ['a', 'b', 'c/', 'x', 'yz']
// the matchResult[odd] is matched and highlighted to red.
if (index % 2 === 1) span.classList.add('ui', 'text', 'red');