folders beta 1
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
<span
|
||||
class="flag mdi"
|
||||
:class="[
|
||||
flagIsLoading(coll.id) ? 'mdi-loading mdi-spin' : flagIsActive(coll.id) ? 'mdi-close isActive' : 'mdi-plus'
|
||||
flagIsLoading(coll.id) ? 'mdi-loading mdi-spin' : flagIsActive(coll.id) ? 'mdi-close-circle isActive' : 'mdi-plus'
|
||||
]"
|
||||
:collid="coll.id"
|
||||
@click.prevent="onFlagActionCard"
|
||||
@@ -64,8 +64,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
...mapActions({
|
||||
flag: 'User/flag',
|
||||
unFlag: 'User/unFlag'
|
||||
flagUnflag: 'User/flagUnflag'
|
||||
}),
|
||||
flagIsActive(collid) {
|
||||
// console.log(this.item.uuid);
|
||||
@@ -82,22 +81,15 @@ export default {
|
||||
if (!this.loadingFlag) {
|
||||
let collid = e.target.getAttribute('collid');
|
||||
let isActive = this.flagIsActive(collid);
|
||||
let action = isActive ? 'unflag' : 'flag';
|
||||
// console.log('collid', collid);
|
||||
// console.log("this.item", this.item);
|
||||
this.loadingFlag = collid;
|
||||
if (isActive) {
|
||||
this.unFlag({uuid: this.item.uuid, collid: collid})
|
||||
.then(data => {
|
||||
console.log("onFlagActionCard then", data);
|
||||
this.loadingFlag = false;
|
||||
})
|
||||
}else{
|
||||
this.flag({uuid: this.item.uuid, collid: collid})
|
||||
.then(data => {
|
||||
console.log("onFlagActionCard then", data);
|
||||
this.loadingFlag = false;
|
||||
})
|
||||
}
|
||||
this.flagUnflag({ action: action, uuid: this.item.uuid, collid: collid})
|
||||
.then(data => {
|
||||
console.log("onFlagActionCard then", data);
|
||||
this.loadingFlag = false;
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user