mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Simple refactoring
This commit is contained in:
parent
25af8559ba
commit
fd917b2e41
@ -1016,9 +1016,10 @@ function addSecondaryModal(field, fields, options) {
|
|||||||
// Extract form values at time of button press
|
// Extract form values at time of button press
|
||||||
var data = extractFormData(fields, options)
|
var data = extractFormData(fields, options)
|
||||||
|
|
||||||
// Allow the secondary form to be "prefilled" with a custom function
|
// If the "fields" attribute is a function, call it with data
|
||||||
if (secondary.prefill) {
|
if (secondary.fields instanceof Function) {
|
||||||
secondary.fields = secondary.prefill(data);
|
console.log("Fields is a function!");
|
||||||
|
secondary.fields = secondary.fields(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
// If no onSuccess function is defined, provide a default one
|
// If no onSuccess function is defined, provide a default one
|
||||||
|
Loading…
Reference in New Issue
Block a user