-
Notifications
You must be signed in to change notification settings - Fork 196
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1337 from ebkr/better-online-filtering
Improved online category filtering
- Loading branch information
Showing
5 changed files
with
167 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<template> | ||
<div class="input-group"> | ||
<label>{{ title }}:</label> | ||
<div class="input-group margin-bottom"> | ||
<select class="select select--content-spacing" @change="emitSelected"> | ||
<option selected disabled> | ||
Select a category | ||
</option> | ||
<option v-for="(key, index) in selectableCategories" :key="`category--${key}-${index}`"> | ||
{{ key }} | ||
</option> | ||
</select> | ||
</div> | ||
<div class="tags has-addons" v-if="selectedCategories.length > 0"> | ||
<span class="margin-right" v-for="(key, index) in selectedCategories" :key="`${key}-${index}`"> | ||
<a href="#" @click="emitDeselected(key)"> | ||
<div class="tag has-addons"> | ||
<span>{{ key }}</span> | ||
</div> | ||
<span class="tag is-delete is-danger"> </span> | ||
</a> | ||
</span> | ||
</div> | ||
<div class="field has-addons" v-else> | ||
<span class="tags"> | ||
<span class="tag">No categories selected</span> | ||
</span> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import { Component, Prop, Vue } from 'vue-property-decorator'; | ||
@Component | ||
export default class ChangeSelectorModal extends Vue { | ||
@Prop({required: true}) | ||
private title!: string; | ||
@Prop({required: true}) | ||
private selectedCategories!: string[] | ||
@Prop({required: true}) | ||
private selectableCategories!: string[] | ||
emitSelected(event: Event) { | ||
this.$emit("selected-category", event); | ||
} | ||
emitDeselected(key: string) { | ||
this.$emit("deselected-category", key); | ||
} | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters