mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-10-31 21:25:42 +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:
		| @@ -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. | ||||
|   | ||||
		Reference in New Issue
	
	Block a user