Skip to content

Commit

Permalink
disable extract selected button when nothing is selected
Browse files Browse the repository at this point in the history
  • Loading branch information
barnabwhy committed Mar 1, 2024
1 parent b2625e0 commit 135cad2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/FileTree.vue
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ watch(selectMode, (newVal) => {
<input type="checkbox" v-model="selectMode">
</label>
<br>
<button v-if="selectMode" @click="mainStore.extractFiles([...checkedFiles])">Extract selected</button>
<button v-if="selectMode" @click="mainStore.extractFiles([...checkedFiles])" :disabled="checkedFiles.size == 0">Extract selected</button>
<button v-else @click="mainStore.extractAll">Extract all</button>
</div>
</div>
Expand Down
6 changes: 6 additions & 0 deletions src/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -104,3 +104,9 @@ input[type="checkbox"] {
accent-color: var(--color-primary-light);
box-shadow: none;
}

button:disabled {
opacity: 0.875;
filter: brightness(0.875);
pointer-events: none;
}

0 comments on commit 135cad2

Please sign in to comment.