Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Toggle button #37

Merged
merged 3 commits into from
Nov 3, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
brings toggle button style in line with app
  • Loading branch information
LeopoldoMoreno committed Nov 3, 2023
commit 18118f0bcb8a5780b0cb66b76d241c8015b608cb
26 changes: 26 additions & 0 deletions frontend/src/components/websites/DisplayedWebsites.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
</div>
</div>
<q-linear-progress :value="getSearchProgress" size="5px" :animation-speed="500" v-if="searching" key="something" />
<!-- Add a button to toggle all checkboxes -->
<button @click="toggleAllSelectionBoxes" class="center-button">Toggle All</button>
</div>
</template>

Expand Down Expand Up @@ -45,6 +47,14 @@ export default defineComponent({
})
this.selectedWebsites = newSelectedWebsites
},
toggleAllSelectionBoxes() {
const allSelected = Object.values(this.selectedWebsites).every(selected => selected);
const newSelectedWebsites = {};
Object.keys(this.selectedWebsites).forEach(website => {
newSelectedWebsites[website] = !allSelected;
});
this.selectedWebsites = newSelectedWebsites;
},
},
watch: {
websites() {
Expand Down Expand Up @@ -78,6 +88,7 @@ export default defineComponent({
border-radius: 15px;
max-width: 80%;
margin-top: 10px;
padding-bottom: 10px;
overflow: hidden;

.websites {
Expand Down Expand Up @@ -107,4 +118,19 @@ export default defineComponent({
}
}
}

.center-button {
margin: 7px auto;
display: block;
padding: 5px;
border-radius: 7px;
background-color: rgba(0, 0, 0, 0);
color: var(--q-primary);
font-weight: bold;
}

.center-button:active {
position: relative;
top: 1px;
}
</style>