mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Function to insert a 'create new' button into a form
- Look for a label like <label for="id_<field>">
This commit is contained in:
parent
0cc2e71843
commit
a96cd2240c
@ -192,6 +192,16 @@
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/* Force a control-label div to be 100% width */
|
||||
.modal .control-label {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.modal .control-label .btn {
|
||||
padding-top: 3px;
|
||||
padding-bottom: 3px;
|
||||
}
|
||||
|
||||
/* The side navigation menu */
|
||||
.sidenav {
|
||||
height: 100%; /* 100% Full-height */
|
||||
|
@ -354,6 +354,18 @@ function injectModalForm(modal, form_html) {
|
||||
}
|
||||
|
||||
|
||||
function insertNewItemButton(modal, field, text) {
|
||||
|
||||
var html = "<span style='float: right;'>";
|
||||
|
||||
html += "<div type='button' class='btn btn-primary' id='btn-new-" + field + "'>" + text + "</div>";
|
||||
|
||||
html += "</span>";
|
||||
|
||||
$(modal).find('label[for="id_'+ field + '"]').append(html);
|
||||
}
|
||||
|
||||
|
||||
function handleModalForm(url, options) {
|
||||
/* Update a modal form after data are received from the server.
|
||||
* Manages POST requests until the form is successfully submitted.
|
||||
|
Loading…
Reference in New Issue
Block a user