Improve IdentityPicker
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
parent
48f1d3efc6
commit
eebcd48447
|
@ -4,7 +4,7 @@
|
||||||
<p class="modal-card-title">{{ $t("Pick an identity") }}</p>
|
<p class="modal-card-title">{{ $t("Pick an identity") }}</p>
|
||||||
</header>
|
</header>
|
||||||
<section class="modal-card-body">
|
<section class="modal-card-body">
|
||||||
<div class="list is-hoverable">
|
<div class="list is-hoverable list-none">
|
||||||
<a
|
<a
|
||||||
class="list-item"
|
class="list-item"
|
||||||
v-for="identity in identities"
|
v-for="identity in identities"
|
||||||
|
@ -12,7 +12,7 @@
|
||||||
:class="{
|
:class="{
|
||||||
'is-active': currentIdentity && identity.id === currentIdentity.id,
|
'is-active': currentIdentity && identity.id === currentIdentity.id,
|
||||||
}"
|
}"
|
||||||
@click="changeCurrentIdentity(identity)"
|
@click="currentIdentity = identity"
|
||||||
>
|
>
|
||||||
<div class="media">
|
<div class="media">
|
||||||
<img
|
<img
|
||||||
|
@ -60,10 +60,11 @@ export default class IdentityPicker extends Vue {
|
||||||
|
|
||||||
identities: IActor[] = [];
|
identities: IActor[] = [];
|
||||||
|
|
||||||
currentIdentity: IActor = this.value;
|
get currentIdentity(): IActor {
|
||||||
|
return this.value;
|
||||||
|
}
|
||||||
|
|
||||||
changeCurrentIdentity(identity: IActor): void {
|
set currentIdentity(identity: IActor) {
|
||||||
this.currentIdentity = identity;
|
|
||||||
this.$emit("input", identity);
|
this.$emit("input", identity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue