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