Skip to content

Commit 86df3b8

Browse files
committed
show select branches in dropdown if ShowAll is selected
1 parent c7deb44 commit 86df3b8

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

web/dropdown.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,18 +140,26 @@ class Dropdown {
140140
return false;
141141
}
142142

143+
/**
144+
* Is Show All selected in the dropdown
145+
* @returns TRUE => Show All is selected, FALSE => Show All is not selected
146+
*/
147+
public isShowAllSelected() {
148+
return this.optionsSelected[0];
149+
}
150+
143151
/**
144152
* Select a specific value in the dropdown.
145153
* @param value The value to select.
146154
*/
147155
public selectOption(value: string) {
148156
const optionIndex = this.options.findIndex((option) => value === option.value);
149157
if (optionIndex < 0 && (this.optionsSelected[0] || this.optionsSelected[optionIndex])) return;
150-
if (this.multipleAllowed && !this.selectMultipleWithCtrl) {
158+
if (this.multipleAllowed && !this.selectMultipleWithCtrl && !this.optionsSelected[0]) {
151159
// Select the option with the specified value
152160
this.optionsSelected[optionIndex] = true;
153161
} else {
154-
for (let i = 1; i < this.optionsSelected.length; i++) {
162+
for (let i = 0; i < this.optionsSelected.length; i++) {
155163
this.optionsSelected[i] = false;
156164
}
157165
this.optionsSelected[optionIndex] = true;

web/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1134,7 +1134,7 @@ class GitGraphView {
11341134
},
11351135
{
11361136
title: 'Select in Branches Dropdown',
1137-
visible: visibility.selectInBranchesDropdown && !isSelectedInBranchesDropdown,
1137+
visible: visibility.selectInBranchesDropdown && (!isSelectedInBranchesDropdown || this.branchDropdown.isShowAllSelected()),
11381138
onClick: () => this.branchDropdown.selectOption(refName)
11391139
},
11401140
{

0 commit comments

Comments
 (0)