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 () {
|
onInput () {
|
||||||
this.search(this.query)
|
this.search(this.query)
|
||||||
},
|
},
|
||||||
selectUser (user, event) {
|
selectUser (user) {
|
||||||
if (this.selectedUserIds.includes(user.id)) {
|
if (this.selectedUserIds.includes(user.id)) {
|
||||||
this.removeUser(user.id)
|
this.removeUser(user.id)
|
||||||
event.target.classList.remove('selected')
|
|
||||||
} else {
|
} else {
|
||||||
this.addUser(user)
|
this.addUser(user)
|
||||||
event.target.classList.add('selected')
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
isSelected (user) {
|
||||||
|
return this.selectedUserIds.includes(user.id)
|
||||||
|
},
|
||||||
addUser (user) {
|
addUser (user) {
|
||||||
this.selectedUserIds.push(user.id)
|
this.selectedUserIds.push(user.id)
|
||||||
},
|
},
|
||||||
|
|
|
@ -41,9 +41,11 @@
|
||||||
:key="user.id"
|
:key="user.id"
|
||||||
class="member"
|
class="member"
|
||||||
>
|
>
|
||||||
<div @click.capture.prevent="selectUser(user, $event)">
|
<BasicUserCard
|
||||||
<BasicUserCard :user="user" />
|
:user="user"
|
||||||
</div>
|
:class="isSelected(user) ? 'selected' : ''"
|
||||||
|
@click.capture.prevent="selectUser(user)"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<button
|
<button
|
||||||
|
|
|
@ -51,15 +51,16 @@ const ListNew = {
|
||||||
onInput () {
|
onInput () {
|
||||||
this.search(this.query)
|
this.search(this.query)
|
||||||
},
|
},
|
||||||
selectUser (user, event) {
|
selectUser (user) {
|
||||||
if (this.selectedUserIds.includes(user.id)) {
|
if (this.selectedUserIds.includes(user.id)) {
|
||||||
this.removeUser(user.id)
|
this.removeUser(user.id)
|
||||||
event.target.classList.remove('selected')
|
|
||||||
} else {
|
} else {
|
||||||
this.addUser(user)
|
this.addUser(user)
|
||||||
event.target.classList.add('selected')
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
isSelected (user) {
|
||||||
|
return this.selectedUserIds.includes(user.id)
|
||||||
|
},
|
||||||
addUser (user) {
|
addUser (user) {
|
||||||
this.selectedUserIds.push(user.id)
|
this.selectedUserIds.push(user.id)
|
||||||
},
|
},
|
||||||
|
|
|
@ -41,9 +41,11 @@
|
||||||
:key="user.id"
|
:key="user.id"
|
||||||
class="member"
|
class="member"
|
||||||
>
|
>
|
||||||
<div @click.capture.prevent="selectUser(user, $event)">
|
<BasicUserCard
|
||||||
<BasicUserCard :user="user" />
|
:user="user"
|
||||||
</div>
|
:class="isSelected(user) ? 'selected' : ''"
|
||||||
|
@click.capture.prevent="selectUser(user)"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<button
|
<button
|
||||||
|
|
Loading…
Reference in a new issue