fixed cancel button of background image prompt to not reset background image (fixes #13)

This commit is contained in:
Steffen 2020-05-24 22:27:19 +02:00
parent e68a3fd067
commit e6190f5e90
No known key found for this signature in database
GPG Key ID: 764D74E98267DFC6
1 changed files with 21 additions and 21 deletions

View File

@ -1,16 +1,16 @@
<template> <template>
<div id="controls"> <div id="controls">
<Screenshot ref="screenshot"></Screenshot> <Screenshot ref="screenshot"></Screenshot>
<span class="session"> <span
<font-awesome-icon class="session"
@click="leaveSession"
icon="broadcast-tower"
v-if="session.sessionId"
:class="{ spectator: session.isSpectator }" :class="{ spectator: session.isSpectator }"
v-if="session.sessionId"
@click="leaveSession"
:title=" :title="
`You're currently in a live game with ${session.playerCount} other players!` `You're currently in a live game with ${session.playerCount} other players!`
" "
/> >
<font-awesome-icon icon="broadcast-tower" />
{{ session.playerCount }} {{ session.playerCount }}
</span> </span>
<span class="camera"> <span class="camera">
@ -127,10 +127,11 @@ export default {
this.$refs.screenshot.capture(dimensions); this.$refs.screenshot.capture(dimensions);
}, },
setBackground() { setBackground() {
this.$store.commit( const background = prompt("Enter custom background URL");
"setBackground", if (background || background === "") {
prompt("Enter custom background URL") this.$store.commit("setBackground", background);
); }
}, },
hostSession() { hostSession() {
const sessionId = prompt( const sessionId = prompt(
@ -248,21 +249,20 @@ export default {
} }
} }
> span > svg { > span {
display: inline-block;
cursor: pointer; cursor: pointer;
z-index: 5; z-index: 5;
margin-top: 10px; margin-top: 7px;
margin-left: 10px; margin-left: 10px;
} }
.session { .session {
.fa-broadcast-tower {
color: $demon; color: $demon;
&.spectator { &.spectator {
color: $townsfolk; color: $townsfolk;
} }
} }
}
} }
.menu { .menu {