Skip to content

Commit

Permalink
Merge pull request #393 from christianlupus/dev/issue-385-checking-in…
Browse files Browse the repository at this point in the history
…gredients

Added option to check ingredients
  • Loading branch information
christianlupus authored Dec 21, 2020
2 parents 5f0cbbb + d929b54 commit 7c89ba9
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
[#433](https://github.com/nextcloud/cookbook/pull/433) @christianlupus
- Category and keyword selection from list of existing ones in recipe editor
[#402](https://github.com/nextcloud/cookbook/pull/402/) @seyfeb
- Allow checking of ingredients in web UI
[#393](https://github.com/nextcloud/cookbook/pull/393) @christianlupus

### Changed
- Switch of project ownership to neextcloud organization in GitHub
Expand Down
25 changes: 23 additions & 2 deletions src/components/RecipeIngredient.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<template>
<li :class="{ 'header': isHeader() }">{{ displayIngredient }}</li>
<li :class="{ 'header': isHeader() }" @click="toggleDone">
<div class="checkmark" :class="{ 'done': isDone }">✔</div>
{{ displayIngredient }}
</li>
</template>

<script>
Expand All @@ -9,6 +12,7 @@ export default {
data () {
return {
headerPrefix: "## ",
isDone: false,
}
},
computed: {
Expand All @@ -25,6 +29,9 @@ export default {
return true
}
return false
},
toggleDone: function() {
this.isDone = !this.isDone
}
}
Expand All @@ -43,5 +50,19 @@ li {
list-style-type: none;
font-variant: small-caps;
}
li > div.checkmark {
display: inline;
visibility: hidden;
}
li > div.done {
visibility: visible;
}
li:hover > div.checkmark {
visibility: visible;
opacity: 0.5;
color: var(--color-primary-element);
}
</style>

0 comments on commit 7c89ba9

Please sign in to comment.