translated delete folder dialog, added closed event

This commit is contained in:
Bachir Soussi Chiadmi 2021-03-11 19:53:56 +01:00
parent 88445b4397
commit ec6ab0dc7b
2 changed files with 645 additions and 29 deletions

File diff suppressed because one or more lines are too long

View File

@ -31,7 +31,7 @@
/> />
</li> </li>
</ul> </ul>
<v-dialog/> <v-dialog @closed="dialogEvent('closed')"/>
</div> </div>
</template> </template>
@ -93,35 +93,45 @@ export default {
this.confirmDeleteFlagColl(flagcollid) this.confirmDeleteFlagColl(flagcollid)
}, },
confirmDeleteFlagColl (flagcollid){ confirmDeleteFlagColl (flagcollid){
console.log('confirmDeleteFlagCOll', flagcollid, this.flagcolls); // console.log('confirmDeleteFlagCOll', flagcollid, this.flagcolls);
// const index = this.flagcolls.findIndex(i => i.id === flagcollid) // const index = this.flagcolls.findIndex(i => i.id === flagcollid)
let coll = this.flagcolls[flagcollid] let coll = this.flagcolls[flagcollid]
// console.log("coll to delete", coll); // console.log("coll to delete", coll);
this.$modal.show('dialog', { this.$modal.show('dialog',
title: "Folder delete", { // component props
text: `Please confirm the definitive deletion of ${coll.name} ?`, title: this.$t("materio.Folder delete"),
text: this.$t(`materio.Please confirm the definitive deletion of {name} ?`, { name: coll.name }),
buttons: [ buttons: [
{ {
title: 'Cancel', title: this.$t('default.Cancel'),
default: true, default: true,
handler: () => { handler: () => {
// this.is_deleting_folder = false;
this.$modal.hide('dialog') this.$modal.hide('dialog')
} }
}, },
{ {
title: 'Delete', title: this.$t('default.Delete'),
handler: () => { handler: () => {
console.log('deletion confirmed', flagcollid); // console.log('deletion confirmed', flagcollid);
this.deleteFlagColl(flagcollid) this.deleteFlagColl(flagcollid)
.then(() => { .then(() => {
// console.log("onDeleteFlagColl then", data); // console.log("onDeleteFlagColl then", data);
this.is_deleting_folder = false; // this.is_deleting_folder = false;
this.$modal.hide('dialog') this.$modal.hide('dialog')
}) })
} }
} }
] ]
}) }
)
},
dialogEvent (eventName) {
console.log("dialog event", eventName)
switch(eventName){
case 'closed':
this.is_deleting_folder = false
}
}, },
onOpenFlagColl (e) { onOpenFlagColl (e) {
const flagcollid = e.target.getAttribute('flagcollid'); const flagcollid = e.target.getAttribute('flagcollid');