added folder deletion confirmation
This commit is contained in:
parent
e0f8b123f9
commit
df71378e5f
File diff suppressed because one or more lines are too long
|
@ -21,7 +21,7 @@ import CoolLightBox from 'vue-cool-lightbox'
|
|||
Vue.use(CoolLightBox)
|
||||
|
||||
import VModal from 'vue-js-modal'
|
||||
Vue.use(VModal)
|
||||
Vue.use(VModal, { dialog: true })
|
||||
|
||||
import store from 'vuejs/store'
|
||||
import router from 'vuejs/route'
|
||||
|
|
|
@ -170,7 +170,7 @@
|
|||
</vsa-content>
|
||||
</vsa-item> -->
|
||||
|
||||
<vsa-item v-if="material.linked_materials">
|
||||
<vsa-item v-if="material.linked_materials.length">
|
||||
<vsa-heading>
|
||||
<span class="label">{{ $t("materio.Linked materials") }}</span>
|
||||
</vsa-heading>
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
/>
|
||||
</li>
|
||||
</ul>
|
||||
<v-dialog/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
@ -88,10 +89,38 @@ export default {
|
|||
const flagcollid = e.target.getAttribute('flagcollid');
|
||||
console.log("UserFlags onDeleteFlagColl", flagcollid);
|
||||
this.is_deleting_folder = flagcollid;
|
||||
// TODO: confirm suppression
|
||||
this.confirmDeleteFlagColl(flagcollid)
|
||||
},
|
||||
confirmDeleteFlagColl (flagcollid){
|
||||
console.log('confirmDeleteFlagCOll', flagcollid, this.flagcolls);
|
||||
// const index = this.flagcolls.findIndex(i => i.id === flagcollid)
|
||||
let coll = this.flagcolls[flagcollid]
|
||||
// console.log("coll to delete", coll);
|
||||
this.$modal.show('dialog', {
|
||||
title: "Folder delete",
|
||||
text: `Please confirm the definitive deletion of ${coll.name} ?`,
|
||||
buttons: [
|
||||
{
|
||||
title: 'Cancel',
|
||||
default: true,
|
||||
handler: () => {
|
||||
this.$modal.hide('dialog')
|
||||
}
|
||||
},
|
||||
{
|
||||
title: 'Delete',
|
||||
handler: () => {
|
||||
console.log('deletion confirmed', flagcollid);
|
||||
this.deleteFlagColl(flagcollid)
|
||||
.then(() => {
|
||||
// console.log("onDeleteFlagColl then", data);
|
||||
this.is_deleting_folder = false;
|
||||
this.$modal.hide('dialog')
|
||||
})
|
||||
}
|
||||
}
|
||||
]
|
||||
})
|
||||
},
|
||||
onOpenFlagColl (e) {
|
||||
|
|
Loading…
Reference in New Issue