|
Lines 11-17
Link Here
|
| 11 |
<h2 v-else>{{ instancedResource.i18n.newLabel }}</h2> |
11 |
<h2 v-else>{{ instancedResource.i18n.newLabel }}</h2> |
| 12 |
<slot |
12 |
<slot |
| 13 |
name="toolbar" |
13 |
name="toolbar" |
| 14 |
:componentPropData="{ ...$props, ...$data, resourceForm }" |
14 |
:componentPropData="{ |
|
|
15 |
...$props, |
| 16 |
...$data, |
| 17 |
resourceForm, |
| 18 |
saveDropdownButtonActions, |
| 19 |
}" |
| 15 |
/> |
20 |
/> |
| 16 |
<form |
21 |
<form |
| 17 |
@submit="saveAndNavigate($event, resourceToSave)" |
22 |
@submit="saveAndNavigate($event, resourceToSave)" |
|
Lines 94-100
Link Here
|
| 94 |
" |
99 |
" |
| 95 |
> |
100 |
> |
| 96 |
<DropdownButtons |
101 |
<DropdownButtons |
| 97 |
:dropdownButtons="dropdownButtons" |
102 |
:dropdownButtons="saveDropdownButtonActions" |
| 98 |
:cssClass="'btn-primary'" |
103 |
:cssClass="'btn-primary'" |
| 99 |
> |
104 |
> |
| 100 |
<ButtonSubmit :title="$__('Save')" /> |
105 |
<ButtonSubmit :title="$__('Save')" /> |
|
Lines 197-206
export default {
Link Here
|
| 197 |
const saveOptionSelected = ref( |
202 |
const saveOptionSelected = ref( |
| 198 |
props.instancedResource.navigationOnFormSave |
203 |
props.instancedResource.navigationOnFormSave |
| 199 |
); |
204 |
); |
| 200 |
const dropdownButtons = computed(() => { |
205 |
const saveDropdownButtonActions = computed(() => { |
| 201 |
const { components, navigationOnFormSave } = |
206 |
const { components, navigationOnFormSave } = |
| 202 |
props.instancedResource; |
207 |
props.instancedResource; |
| 203 |
|
208 |
const formToSubmit = resourceForm.value; |
| 204 |
const buttonOptions = { |
209 |
const buttonOptions = { |
| 205 |
list: { |
210 |
list: { |
| 206 |
title: $__("Save and return to list"), |
211 |
title: $__("Save and return to list"), |
|
Lines 208-213
export default {
Link Here
|
| 208 |
cssClass: "btn btn-default", |
213 |
cssClass: "btn btn-default", |
| 209 |
callback: () => { |
214 |
callback: () => { |
| 210 |
saveOptionSelected.value = components.list; |
215 |
saveOptionSelected.value = components.list; |
|
|
216 |
if ( |
| 217 |
props.instancedResource.stickyToolbar.includes( |
| 218 |
"Form" |
| 219 |
) |
| 220 |
) { |
| 221 |
formToSubmit.value.requestSubmit(); |
| 222 |
} |
| 211 |
}, |
223 |
}, |
| 212 |
}, |
224 |
}, |
| 213 |
show: { |
225 |
show: { |
|
Lines 216-221
export default {
Link Here
|
| 216 |
cssClass: "btn btn-default", |
228 |
cssClass: "btn btn-default", |
| 217 |
callback: () => { |
229 |
callback: () => { |
| 218 |
saveOptionSelected.value = components.show; |
230 |
saveOptionSelected.value = components.show; |
|
|
231 |
if ( |
| 232 |
props.instancedResource.stickyToolbar.includes( |
| 233 |
"Form" |
| 234 |
) |
| 235 |
) { |
| 236 |
formToSubmit.value.requestSubmit(); |
| 237 |
} |
| 219 |
}, |
238 |
}, |
| 220 |
}, |
239 |
}, |
| 221 |
edit: { |
240 |
edit: { |
|
Lines 224-229
export default {
Link Here
|
| 224 |
cssClass: "btn btn-default", |
243 |
cssClass: "btn btn-default", |
| 225 |
callback: () => { |
244 |
callback: () => { |
| 226 |
saveOptionSelected.value = components.edit; |
245 |
saveOptionSelected.value = components.edit; |
|
|
246 |
if ( |
| 247 |
props.instancedResource.stickyToolbar.includes( |
| 248 |
"Form" |
| 249 |
) |
| 250 |
) { |
| 251 |
formToSubmit.value.requestSubmit(); |
| 252 |
} |
| 227 |
}, |
253 |
}, |
| 228 |
}, |
254 |
}, |
| 229 |
}; |
255 |
}; |
|
Lines 241-247
export default {
Link Here
|
| 241 |
resourceForm, |
267 |
resourceForm, |
| 242 |
saveAndNavigate, |
268 |
saveAndNavigate, |
| 243 |
editMode, |
269 |
editMode, |
| 244 |
dropdownButtons, |
270 |
saveDropdownButtonActions, |
| 245 |
}; |
271 |
}; |
| 246 |
}, |
272 |
}, |
| 247 |
props: { |
273 |
props: { |