From 86a0388448e3f218dd05515544e0a12b27acaf38 Mon Sep 17 00:00:00 2001 From: LariWa Date: Thu, 9 Jun 2022 17:18:22 +0200 Subject: [PATCH] show collapse/Expand Btns only in fileTree view --- web/main.ts | 12 +++++++++++- web/styles/main.css | 3 +++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/web/main.ts b/web/main.ts index 829e3561..6cb733c4 100644 --- a/web/main.ts +++ b/web/main.ts @@ -2637,7 +2637,7 @@ class GitGraphView { } html += '
' + SVG_ICONS.close + '
' + (codeReviewPossible ? '
' + SVG_ICONS.review + '
' : '') + - (!expandedCommit.loading ? '
' + SVG_ICONS.fileTree + '
' + SVG_ICONS.fileList + '
' + SVG_ICONS.collapseAll + '
' + SVG_ICONS.expandAll + '
' : '') + + (!expandedCommit.loading ? '
' + SVG_ICONS.fileList + '
' + SVG_ICONS.fileTree + '
' + SVG_ICONS.collapseAll + '
' + SVG_ICONS.expandAll + '
' : '') + (externalDiffPossible ? '
' + SVG_ICONS.linkExternal + '
' : '') + '
'; @@ -3200,6 +3200,16 @@ class GitGraphView { let listView = this.getFileViewType() === GG.FileViewType.List; alterClass(treeBtnElem, CLASS_ACTIVE, !listView); alterClass(listBtnElem, CLASS_ACTIVE, listView); + setFolderBtns(); + function setFolderBtns() { + let btns = document.getElementsByClassName('cdvFolderBtn'); + for (let i = 0; i < btns.length; i++) { + if(listView) + btns[i].classList.add('hidden'); + else + btns[i].classList.remove('hidden'); + } + } } private renderCdvExternalDiffBtn() { diff --git a/web/styles/main.css b/web/styles/main.css index 2e0d1eef..62f71017 100644 --- a/web/styles/main.css +++ b/web/styles/main.css @@ -349,6 +349,9 @@ table { border-collapse: collapse; } .cdvControlBtn.active:hover{ background-color:rgba(128,128,128,0.35); } +.cdvFolderBtn.hidden{ + display:none; +} #cdvCodeReview{ border-radius:4px;