Merge pull request #18 from bra1n/custom-reminder

custom reminder notes
This commit is contained in:
Steffen 2020-05-25 20:51:34 +02:00 committed by GitHub
commit aed1d7a274
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 25 additions and 5 deletions

BIN
src/assets/icons/custom.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 162 KiB

View File

@ -659,6 +659,19 @@ li.move:not(.from) .player > svg.move {
}
}
&.custom {
padding: 5px;
display: flex;
align-items: center;
align-content: center;
justify-content: center;
font-size: 70%;
word-break: break-word;
.icon {
display: none;
}
}
&:hover:before {
opacity: 0;
}

View File

@ -9,13 +9,13 @@
<li
v-for="reminder in availableReminders"
class="reminder"
v-bind:class="[reminder.role]"
v-bind:key="reminder.role + ' ' + reminder.name"
:class="[reminder.role]"
:key="reminder.role + ' ' + reminder.name"
@click="addReminder(reminder)"
>
<span
class="icon"
v-bind:style="{
:style="{
backgroundImage: `url(${require('../../assets/icons/' +
reminder.role +
'.png')})`
@ -48,6 +48,7 @@ export default {
});
reminders.push({ role: "good", name: "Good" });
reminders.push({ role: "evil", name: "Evil" });
reminders.push({ role: "custom", name: "Custom note" });
return reminders;
},
...mapState(["modals"]),
@ -56,7 +57,14 @@ export default {
methods: {
addReminder(reminder) {
const player = this.$store.state.players.players[this.playerIndex];
const value = [...player.reminders, reminder];
let value;
if (reminder.role === "custom") {
const name = prompt("Add a custom reminder note");
if (!name) return;
value = [...player.reminders, { role: "custom", name }];
} else {
value = [...player.reminders, reminder];
}
this.$store.commit("players/update", {
player,
property: "reminders",

View File

@ -90,7 +90,6 @@ export default new Vuex.Store({
}
},
toggleModal({ modals }, name) {
console.log("toggle", name);
modals[name] = !modals[name];
},
updateScreenshot({ grimoire }, status) {