mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Add more modal form funcs
- Function to set the button text
This commit is contained in:
parent
c2bc65f903
commit
87f96d6b3c
@ -1,3 +1,7 @@
|
|||||||
|
function makeOption(id, title) {
|
||||||
|
return "<option value='" + id + "'>" + title + "</option>";
|
||||||
|
}
|
||||||
|
|
||||||
function attachSelect(modal) {
|
function attachSelect(modal) {
|
||||||
|
|
||||||
// Attach to any 'select' inputs on the modal
|
// Attach to any 'select' inputs on the modal
|
||||||
@ -53,6 +57,10 @@ function modalSetContent(modal, content='') {
|
|||||||
$(modal).find('.modal-form-content').html(content);
|
$(modal).find('.modal-form-content').html(content);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function modalSetButtonText(modal, text) {
|
||||||
|
$(modal).find("#modal-form-submit").html(text);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function openModal(modal, title='', content='') {
|
function openModal(modal, title='', content='') {
|
||||||
|
|
||||||
@ -212,7 +220,7 @@ function launchModalForm(modal, url, options = {}) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (response.submit_text) {
|
if (response.submit_text) {
|
||||||
$(modal + ' #modal-form-submit').html(response.submit_text);
|
modalSetButtonText(response.submit_text);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (response.html_form) {
|
if (response.html_form) {
|
||||||
|
Loading…
Reference in New Issue
Block a user