mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-29 13:36:13 +00:00
OnTheFly modal: adapt footer button for show/edit cases (bug minor)
[BUG] to reproduce: * clic first on show item button * in modal clic edit button * close modal * clic again on show item button
This commit is contained in:
parent
718d6c2375
commit
4562ed46db
@ -39,7 +39,12 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template v-slot:footer>
|
<template v-slot:footer>
|
||||||
<button class="sc-button bt-save"> <!-- @click.prevent="$emit('..', ..)" -->
|
<button v-if="action === 'show'"
|
||||||
|
@click="changeActionTo('edit')"
|
||||||
|
class="sc-button bt-update"> <!-- @click.prevent="$emit('..', ..)" -->
|
||||||
|
</button>
|
||||||
|
<button v-else
|
||||||
|
class="sc-button bt-save"> <!-- @click.prevent="$emit('..', ..)" -->
|
||||||
{{ $t('action.save')}}
|
{{ $t('action.save')}}
|
||||||
</button>
|
</button>
|
||||||
</template>
|
</template>
|
||||||
@ -69,10 +74,14 @@ export default {
|
|||||||
modal: {
|
modal: {
|
||||||
showModal: false,
|
showModal: false,
|
||||||
modalDialogClass: "modal-dialog-scrollable modal-xl"
|
modalDialogClass: "modal-dialog-scrollable modal-xl"
|
||||||
}
|
},
|
||||||
|
action: this.action
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
action() {
|
||||||
|
return this.$data.action;
|
||||||
|
},
|
||||||
classAction() {
|
classAction() {
|
||||||
switch (this.action) {
|
switch (this.action) {
|
||||||
case 'show':
|
case 'show':
|
||||||
@ -102,7 +111,7 @@ export default {
|
|||||||
case 'create':
|
case 'create':
|
||||||
return 'onthefly.create.title';
|
return 'onthefly.create.title';
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
openModal() {
|
openModal() {
|
||||||
@ -110,6 +119,10 @@ export default {
|
|||||||
this.$nextTick(function() {
|
this.$nextTick(function() {
|
||||||
//this.$refs.search.focus();
|
//this.$refs.search.focus();
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
changeActionTo(action) {
|
||||||
|
// [BUG] clic first on show item button; in modal clic edit button; close modal; clic again on show item button
|
||||||
|
this.$data.action = action;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -58,7 +58,7 @@ const messages = {
|
|||||||
},
|
},
|
||||||
create: {
|
create: {
|
||||||
button: "Créer \"{q}\"",
|
button: "Créer \"{q}\"",
|
||||||
title: "Saisir à la volée…",
|
title: "Créer à la volée…",
|
||||||
person: "un nouvel usager",
|
person: "un nouvel usager",
|
||||||
thirdparty: "un nouveau tiers"
|
thirdparty: "un nouveau tiers"
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user