Browse Source

Show message if no notes match the filter;

modulation
Nero Ignis 3 years ago
parent
commit
cc91919da1
  1. 18
      src/views/Notes.vue

18
src/views/Notes.vue

@ -56,6 +56,15 @@ @@ -56,6 +56,15 @@
</div>
</div>
</template>
<span v-if="colorToFilter !== '' && !notesExistInFilteredColor">
Keine Notizen mit gewählter Farbe vorhanden<br>
<a href="javascript:"
class="color-change-button disable-filter-button"
:style="'background-color: '+colorToFilter"
v-on:click="colorToFilter = ''">
Filter ausschalten
</a>
</span>
</div>
</div>
</div>
@ -91,6 +100,15 @@ export default { @@ -91,6 +100,15 @@ export default {
note.color = color;
this.$store.commit('saveNotes');
}
},
computed: {
notesExistInFilteredColor() {
let component = this;
return this.$store.state.notes.filter((note) => {
return note.color === component.colorToFilter;
}).length;
}
}
}
</script>

Loading…
Cancel
Save