Skip to content

Commit f8601f3

Browse files
authored
Fix ellipsis in files table (#12617)
Turns out text ellispsis does not work in combination with flexbox and while wrapping in a display:block can help in some cases, I could not get this to work properly so this changes the truncate to inline-block again and reduces the clickable area to just vertical expansion from the links.
1 parent e25d486 commit f8601f3

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

templates/repo/view_list.tmpl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
{{svg "octicon-file-submodule" 16}}
5050
{{$refURL := $commit.RefURL AppUrl $.Repository.FullName}}
5151
{{if $refURL}}
52-
<a class="flex-0" href="{{$refURL}}">{{$entry.Name}}</a><span class="at">@</span><a class="flex-1" href="{{$refURL}}/commit/{{$commit.RefID}}">{{ShortSha $commit.RefID}}</a>
52+
<a href="{{$refURL}}">{{$entry.Name}}</a><span class="at">@</span><a href="{{$refURL}}/commit/{{$commit.RefID}}">{{ShortSha $commit.RefID}}</a>
5353
{{else}}
5454
{{$entry.Name}}<span class="at">@</span>{{ShortSha $commit.RefID}}
5555
{{end}}
@@ -58,7 +58,7 @@
5858
{{$subJumpablePathName := $entry.GetSubJumpablePathName}}
5959
{{$subJumpablePath := SubJumpablePath $subJumpablePathName}}
6060
{{svg "octicon-file-directory" 16}}
61-
<a class="flex-1" href="{{EscapePound $.TreeLink}}/{{EscapePound $subJumpablePathName}}" title="{{$subJumpablePathName}}">
61+
<a href="{{EscapePound $.TreeLink}}/{{EscapePound $subJumpablePathName}}" title="{{$subJumpablePathName}}">
6262
{{if eq (len $subJumpablePath) 2}}
6363
<span class="jumpable-path">{{index $subJumpablePath 0}}</span>{{index $subJumpablePath 1}}
6464
{{else}}
@@ -67,14 +67,14 @@
6767
</a>
6868
{{else}}
6969
{{svg (printf "octicon-%s" (EntryIcon $entry)) 16}}
70-
<a class="flex-1" href="{{EscapePound $.TreeLink}}/{{EscapePound $entry.Name}}" title="{{$entry.Name}}">{{$entry.Name}}</a>
70+
<a href="{{EscapePound $.TreeLink}}/{{EscapePound $entry.Name}}" title="{{$entry.Name}}">{{$entry.Name}}</a>
7171
{{end}}
7272
{{end}}
7373
</span>
7474
</td>
7575
<td class="message nine wide">
7676
<span class="truncate">
77-
<a class="flex-1" href="{{$.RepoLink}}/commit/{{$commit.ID}}" title="{{$commit.Summary}}">{{$commit.Summary | RenderEmoji}}</a>
77+
<a href="{{$.RepoLink}}/commit/{{$commit.ID}}" title="{{$commit.Summary}}">{{$commit.Summary | RenderEmoji}}</a>
7878
</span>
7979
</td>
8080
<td class="text right age three wide">{{TimeSince $commit.Committer.When $.Lang}}</td>

web_src/less/_repository.less

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -362,12 +362,13 @@
362362
}
363363

364364
.truncate {
365-
display: inline-flex;
366-
align-items: center;
365+
display: inline-block;
367366
overflow: hidden;
368367
text-overflow: ellipsis;
369368
white-space: nowrap;
370369
width: 100%;
370+
padding-top: 8px;
371+
padding-bottom: 8px;
371372
}
372373

373374
a {

0 commit comments

Comments
 (0)