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,6 +724,19 @@ $admin-fg: white;
border: 1px solid #808080 !important; border: 1px solid #808080 !important;
position: relative; position: relative;
} }
}
.room-link .v-input__slot::before {
/* Remove text underline */
border-style: none !important;
}
.created-room-welcome-header {
background-color: #e0e0e0;
border-radius: 25px;
margin: 20px;
padding: 20px;
}
.link-copied { .link-copied {
position: absolute; position: absolute;
@ -738,16 +751,3 @@ $admin-fg: white;
vertical-align: middle; vertical-align: middle;
padding-top: 10px; padding-top: 10px;
} }
}
.room-link .v-input__slot::before {
/* Remove text underline */
border-style: none !important;
}
.created-room-welcome-header {
background-color: #e0e0e0;
border-radius: 25px;
margin: 20px;
padding: 20px;
}

View file

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