0
0
mirror of https://github.com/go-gitea/gitea.git synced 2024-12-18 11:03:04 +01:00

Fix word overflow in file search page (#32695) (#32699)

Backport #32695 by yp05327

Co-authored-by: yp05327 <576951401@qq.com>
This commit is contained in:
Giteabot 2024-12-04 08:19:43 +08:00 committed by GitHub
parent 4b73e92264
commit a332805f6e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 1 deletions

View File

@ -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>

View File

@ -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');