mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 16:40:24 +08:00 
			
		
		
		
	Fix PR file tree folders no longer collapsing (#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: zeripath <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
			
			
This commit is contained in:
		@@ -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
 | 
			
		||||
@@ -63,7 +63,7 @@ export default {
 | 
			
		||||
      if (itemIsFile) {
 | 
			
		||||
        return;
 | 
			
		||||
      }
 | 
			
		||||
      this.$set(this, 'collapsed', !this.collapsed);
 | 
			
		||||
      this.collapsed = !this.collapsed;
 | 
			
		||||
    },
 | 
			
		||||
    getIconForDiffType(pType) {
 | 
			
		||||
      const diffTypes = {
 | 
			
		||||
@@ -83,6 +83,7 @@ export default {
 | 
			
		||||
span.svg-icon.status {
 | 
			
		||||
  float: right;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
span.svg-icon.file {
 | 
			
		||||
  color: var(--color-secondary-dark-7);
 | 
			
		||||
}
 | 
			
		||||
@@ -122,6 +123,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 {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user