Skip to content

Commit e31c6cf

Browse files
Fix Show/hide filetree button on small displays (#27881)
the gt-df's display:flex !important did override the display:none on small displays --------- Co-authored-by: wxiaoguang <[email protected]>
1 parent f63b116 commit e31c6cf

File tree

2 files changed

+2
-22
lines changed

2 files changed

+2
-22
lines changed

templates/repo/diff/box.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<div class="diff-detail-box diff-box">
44
<div class="gt-df gt-ac gt-fw">
55
{{if $showFileTree}}
6-
<button class="diff-toggle-file-tree-button gt-df gt-ac not-mobile" data-show-text="{{ctx.Locale.Tr "repo.diff.show_file_tree"}}" data-hide-text="{{ctx.Locale.Tr "repo.diff.hide_file_tree"}}">
6+
<button class="diff-toggle-file-tree-button not-mobile btn interact-fg" data-show-text="{{ctx.Locale.Tr "repo.diff.show_file_tree"}}" data-hide-text="{{ctx.Locale.Tr "repo.diff.hide_file_tree"}}">
77
{{/* the icon meaning is reversed here, "octicon-sidebar-collapse" means show the file tree */}}
88
{{svg "octicon-sidebar-collapse" 20 "icon gt-hidden"}}
99
{{svg "octicon-sidebar-expand" 20 "icon gt-hidden"}}
@@ -89,7 +89,7 @@
8989
{{end}}
9090
<div id="diff-container">
9191
{{if $showFileTree}}
92-
<div id="diff-file-tree" class="gt-hidden"></div>
92+
<div id="diff-file-tree" class="gt-hidden not-mobile"></div>
9393
<script>
9494
if (diffTreeVisible) document.getElementById('diff-file-tree').classList.remove('gt-hidden');
9595
</script>

web_src/css/repo.css

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2743,26 +2743,6 @@ tbody.commit-list {
27432743
overflow-y: auto;
27442744
}
27452745

2746-
.diff-toggle-file-tree-button {
2747-
background: none;
2748-
border: none;
2749-
user-select: none;
2750-
color: inherit;
2751-
}
2752-
2753-
.diff-toggle-file-tree-button:hover {
2754-
color: var(--color-primary);
2755-
}
2756-
2757-
@media (max-width: 991.98px) {
2758-
#diff-file-tree {
2759-
display: none !important;
2760-
}
2761-
.diff-toggle-file-tree-button {
2762-
display: none !important;
2763-
}
2764-
}
2765-
27662746
.ui.message.unicode-escape-prompt {
27672747
margin-bottom: 0;
27682748
border-radius: 0;

0 commit comments

Comments
 (0)