forked from AkkomaGang/akkoma-fe
Fix account selection garbage
This commit is contained in:
parent
cf33b3295f
commit
d1af4bdd51
4 changed files with 18 additions and 12 deletions
|
@ -57,15 +57,16 @@ const ListNew = {
|
|||
onInput () {
|
||||
this.search(this.query)
|
||||
},
|
||||
selectUser (user, event) {
|
||||
selectUser (user) {
|
||||
if (this.selectedUserIds.includes(user.id)) {
|
||||
this.removeUser(user.id)
|
||||
event.target.classList.remove('selected')
|
||||
} else {
|
||||
this.addUser(user)
|
||||
event.target.classList.add('selected')
|
||||
}
|
||||
},
|
||||
isSelected (user) {
|
||||
return this.selectedUserIds.includes(user.id)
|
||||
},
|
||||
addUser (user) {
|
||||
this.selectedUserIds.push(user.id)
|
||||
},
|
||||
|
|
|
@ -41,9 +41,11 @@
|
|||
:key="user.id"
|
||||
class="member"
|
||||
>
|
||||
<div @click.capture.prevent="selectUser(user, $event)">
|
||||
<BasicUserCard :user="user" />
|
||||
</div>
|
||||
<BasicUserCard
|
||||
:user="user"
|
||||
:class="isSelected(user) ? 'selected' : ''"
|
||||
@click.capture.prevent="selectUser(user)"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<button
|
||||
|
|
|
@ -51,15 +51,16 @@ const ListNew = {
|
|||
onInput () {
|
||||
this.search(this.query)
|
||||
},
|
||||
selectUser (user, event) {
|
||||
selectUser (user) {
|
||||
if (this.selectedUserIds.includes(user.id)) {
|
||||
this.removeUser(user.id)
|
||||
event.target.classList.remove('selected')
|
||||
} else {
|
||||
this.addUser(user)
|
||||
event.target.classList.add('selected')
|
||||
}
|
||||
},
|
||||
isSelected (user) {
|
||||
return this.selectedUserIds.includes(user.id)
|
||||
},
|
||||
addUser (user) {
|
||||
this.selectedUserIds.push(user.id)
|
||||
},
|
||||
|
|
|
@ -41,9 +41,11 @@
|
|||
:key="user.id"
|
||||
class="member"
|
||||
>
|
||||
<div @click.capture.prevent="selectUser(user, $event)">
|
||||
<BasicUserCard :user="user" />
|
||||
</div>
|
||||
<BasicUserCard
|
||||
:user="user"
|
||||
:class="isSelected(user) ? 'selected' : ''"
|
||||
@click.capture.prevent="selectUser(user)"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<button
|
||||
|
|
Loading…
Reference in a new issue