Merge branch '192-improve-interaction-of-input-bar-for-changing-identity' into 'dev'
Resolve "Improve interaction of input bar for changing identity" See merge request keanuapp/keanuapp-weblite!51
This commit is contained in:
commit
26578fe296
3 changed files with 44 additions and 12 deletions
|
|
@ -147,7 +147,7 @@
|
||||||
color="primary"
|
color="primary"
|
||||||
text
|
text
|
||||||
@click="
|
@click="
|
||||||
setDisplayName(editValue);
|
updateDisplayName(editValue);
|
||||||
showEditDisplaynameDialog = false;
|
showEditDisplaynameDialog = false;
|
||||||
"
|
"
|
||||||
>{{ $t("menu.ok") }}</v-btn
|
>{{ $t("menu.ok") }}</v-btn
|
||||||
|
|
@ -241,10 +241,6 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
setDisplayName(name) {
|
|
||||||
this.$matrix.matrixClient.setDisplayName(name);
|
|
||||||
},
|
|
||||||
|
|
||||||
setPassword(oldPassword, newPassword) {
|
setPassword(oldPassword, newPassword) {
|
||||||
this.settingPassword = true;
|
this.settingPassword = true;
|
||||||
this.passwordErrorMessage = null;
|
this.passwordErrorMessage = null;
|
||||||
|
|
|
||||||
|
|
@ -9,18 +9,32 @@
|
||||||
<div class="you-are">{{ $t("profile_info_popup.you_are") }}</div>
|
<div class="you-are">{{ $t("profile_info_popup.you_are") }}</div>
|
||||||
<v-container fluid>
|
<v-container fluid>
|
||||||
<v-row>
|
<v-row>
|
||||||
<v-col class="username" cols="pa-2">
|
<v-col :class="['username',{'editable': editDisplayName }]" cols="pa-2" ref="username">
|
||||||
<div v-if="$matrix.currentUser.is_guest">
|
<div v-if="$matrix.currentUser.is_guest">
|
||||||
<i18n path="profile_info_popup.identity_temporary" tag="span">
|
<i18n path="profile_info_popup.identity_temporary" tag="span">
|
||||||
<template v-slot:displayName>
|
<template v-slot:displayName>
|
||||||
<b>{{ displayName }}</b>
|
<input
|
||||||
|
v-model="displayName"
|
||||||
|
@blur="
|
||||||
|
updateDisplayName($event.target.value);
|
||||||
|
editDisplayName = !editDisplayName;
|
||||||
|
"
|
||||||
|
@focus="editDisplayName = !editDisplayName"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
</i18n>
|
</i18n>
|
||||||
</div>
|
</div>
|
||||||
<div v-else>
|
<div v-else>
|
||||||
<i18n path="profile_info_popup.identity" tag="span">
|
<i18n path="profile_info_popup.identity" tag="span">
|
||||||
<template v-slot:displayName>
|
<template v-slot:displayName>
|
||||||
<b>{{ displayName }}</b>
|
<input
|
||||||
|
v-model="displayName"
|
||||||
|
@blur="
|
||||||
|
updateDisplayName($event.target.value);
|
||||||
|
editDisplayName = !editDisplayName;
|
||||||
|
"
|
||||||
|
@focus="editDisplayName = !editDisplayName"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
</i18n>
|
</i18n>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -93,6 +107,7 @@ export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
showDialog: false,
|
showDialog: false,
|
||||||
|
editDisplayName: false
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
|
@ -165,6 +180,19 @@ export default {
|
||||||
.username {
|
.username {
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
background-color: #f5f5f5;
|
background-color: #f5f5f5;
|
||||||
|
|
||||||
|
&.editable {
|
||||||
|
background-color: unset;
|
||||||
|
box-shadow: 0px 2px 6px rgb(0 0 0 / 8%);
|
||||||
|
}
|
||||||
|
|
||||||
|
input {
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
&:focus {
|
||||||
|
outline: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.more-container {
|
.more-container {
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
|
|
|
||||||
|
|
@ -7,11 +7,16 @@ export default {
|
||||||
return this.$matrix.matrixClient.getUser(this.$matrix.currentUserId);
|
return this.$matrix.matrixClient.getUser(this.$matrix.currentUserId);
|
||||||
},
|
},
|
||||||
|
|
||||||
displayName() {
|
displayName: {
|
||||||
if (!this.user) {
|
get() {
|
||||||
return null;
|
if (!this.user) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return (this.user.displayName || this.user.userId);
|
||||||
|
},
|
||||||
|
set(newValue) {
|
||||||
|
this.user.displayName = newValue
|
||||||
}
|
}
|
||||||
return (this.user.displayName || this.user.userId);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
userAvatar() {
|
userAvatar() {
|
||||||
|
|
@ -40,5 +45,8 @@ export default {
|
||||||
this.$navigation.push({path: "/login"}, -1);
|
this.$navigation.push({path: "/login"}, -1);
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
updateDisplayName(name) {
|
||||||
|
this.$matrix.matrixClient.setDisplayName(name);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue