diff options
author | Yarden Shoham <hrsi88@gmail.com> | 2023-02-12 13:14:19 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-12 13:14:19 +0200 |
commit | 656d5a144fa4185b203e5e4d033e829449f9f6d1 (patch) | |
tree | fc0cf89a9bb7ab44900c6fdcebfec6183086b231 | |
parent | 43d1183f67783ff5d5a7ebecaf22da36e57dbb8e (diff) | |
download | gitea-656d5a144fa4185b203e5e4d033e829449f9f6d1.tar.gz gitea-656d5a144fa4185b203e5e4d033e829449f9f6d1.zip |
Fix PR file tree folders no longer collapsing (#22864) (#22872)
Backport #22864
Collapsing folders currently just throws a console error
```
index.js?v=1.19.0~dev-403-gb6b8feb3d:10 TypeError: this.$set is not a function
at Proxy.handleClick (index.js?v=1.19.0~dev-403-gb6b8feb3d:58:7159)
at index.js?v=1.19.0~dev-403-gb6b8feb3d:58:6466
at index.js?v=1.19.0~dev-403-gb6b8feb3d:10:93922
at ce (index.js?v=1.19.0~dev-403-gb6b8feb3d:10:1472)
at Q (index.js?v=1.19.0~dev-403-gb6b8feb3d:10:1567)
at HTMLDivElement.$e (index.js?v=1.19.0~dev-403-gb6b8feb3d:10:79198)
```
This PR fixes this and allows folders to be collapsed again.
Also:
- better cursor interaction with folders
- added some color to the diff detail stats
- remove green link color from all the file names
Screenshots:


Co-authored-by: gempir <daniel.pasch.s@gmail.com>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
-rw-r--r-- | web_src/js/components/DiffFileTreeItem.vue | 7 | ||||
-rw-r--r-- | web_src/less/_repository.less | 14 |
2 files changed, 19 insertions, 2 deletions
diff --git a/web_src/js/components/DiffFileTreeItem.vue b/web_src/js/components/DiffFileTreeItem.vue index 4f20f1e66a..d3e377fc34 100644 --- a/web_src/js/components/DiffFileTreeItem.vue +++ b/web_src/js/components/DiffFileTreeItem.vue @@ -10,7 +10,7 @@ /> <a v-if="item.isFile" - class="file ellipsis" + class="file ellipsis muted" :href="item.isFile ? '#diff-' + item.file.NameHash : ''" >{{ item.name }}</a> <SvgIcon @@ -68,7 +68,7 @@ export default { if (itemIsFile) { return; } - this.$set(this, 'collapsed', !this.collapsed); + this.collapsed = !this.collapsed; }, getIconForDiffType(pType) { const diffTypes = { @@ -88,6 +88,7 @@ export default { span.svg-icon.status { float: right; } + span.svg-icon.file { color: var(--color-secondary-dark-7); } @@ -127,6 +128,8 @@ span.svg-icon.octicon-diff-renamed { div.directory { display: grid; grid-template-columns: 18px 20px auto; + user-select: none; + cursor: pointer; } div.directory:hover { diff --git a/web_src/less/_repository.less b/web_src/less/_repository.less index a3b373f43b..954577c878 100644 --- a/web_src/less/_repository.less +++ b/web_src/less/_repository.less @@ -1608,6 +1608,20 @@ margin-right: .25rem; } + // Because the translations contain the <strong> we need to style with nth-of-type + + .diff-detail-stats strong:nth-of-type(1) { + color: var(--color-yellow); + } + + .diff-detail-stats strong:nth-of-type(2) { + color: var(--color-green); + } + + .diff-detail-stats strong:nth-of-type(3) { + color: var(--color-red); + } + .diff-detail-stats { @media (max-width: 480px) { font-size: 0; |