mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Open a secondary modal over the top of a primary one
This commit is contained in:
parent
dc3abec899
commit
226644e59a
@ -385,10 +385,24 @@ function attachSecondaryModal(modal, options) {
|
||||
* field: Name of the field to attach to
|
||||
* label: Button text
|
||||
* title: Hover text to display over button (optional)
|
||||
* url: URL for the secondary modal
|
||||
* query: Query params for the secondary modal
|
||||
*/
|
||||
|
||||
// Insert the button
|
||||
insertNewItemButton(modal, options);
|
||||
|
||||
// Add a callback to the button
|
||||
$(modal).find("#btn-new-" + options.field).on('click', function() {
|
||||
|
||||
// Launch the secondary modal
|
||||
launchModalForm(
|
||||
options.url,
|
||||
{
|
||||
modal: '#modal-form-secondary',
|
||||
}
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
@ -128,17 +128,19 @@
|
||||
|
||||
attachSecondaryModal(modal,
|
||||
{
|
||||
'field': 'part',
|
||||
'label': 'New Part',
|
||||
'title': 'Create New Part',
|
||||
field: 'part',
|
||||
label: 'New Part',
|
||||
title: 'Create New Part',
|
||||
url: "{% url 'part-create' %}",
|
||||
}
|
||||
);
|
||||
|
||||
attachSecondaryModal(modal,
|
||||
{
|
||||
'field': 'location',
|
||||
'label': 'New Location',
|
||||
'title': 'Create New Location'
|
||||
field: 'location',
|
||||
label: 'New Location',
|
||||
title: 'Create New Location',
|
||||
url: "{% url 'stock-location-create' %}",
|
||||
}
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user