Add "link copied!" toast to room info

This commit is contained in:
N-Pex 2021-04-02 09:43:58 +02:00
parent 73f7a0d4d8
commit b7d280f675
2 changed files with 24 additions and 17 deletions

View file

@ -724,20 +724,6 @@ $admin-fg: white;
border: 1px solid #808080 !important;
position: relative;
}
.link-copied {
position: absolute;
bottom: 10px;
left: 20%;
right: 20%;
background-color: #888888;
height: 50px;
border-radius: 25px;
color: white;
text-align: center;
vertical-align: middle;
padding-top: 10px;
}
}
.room-link .v-input__slot::before {
@ -750,4 +736,18 @@ $admin-fg: white;
border-radius: 25px;
margin: 20px;
padding: 20px;
}
.link-copied {
position: absolute;
bottom: 10px;
left: 20%;
right: 20%;
background-color: #888888;
height: 50px;
border-radius: 25px;
color: white;
text-align: center;
vertical-align: middle;
padding-top: 10px;
}

View file

@ -60,6 +60,7 @@
type="text"
@click:append="copyRoomLink"
></v-text-field>
<div v-if="publicRoomLinkCopied" class="link-copied">Link copied!</div>
</v-radio-group>
<!-- <div v-if="anyoneCanJoin">
@ -183,6 +184,7 @@ export default {
expandedMembers: [],
buildVersion: "",
updatingJoinRule: false, // Flag if we are processing update curerntly
publicRoomLinkCopied: false,
};
},
mounted() {
@ -311,10 +313,15 @@ export default {
},
copyRoomLink() {
const self = this;
this.$copyText(this.publicRoomLink).then(
function (e) {
console.log(e);
},
function (ignored) {
// Success!
self.publicRoomLinkCopied = true;
setInterval(() => {
// Hide again
self.publicRoomLinkCopied = false;
}, 3000); },
function (e) {
console.log(e);
}