From 87f96d6b3c47b6b782321e80323273d92bd1bf32 Mon Sep 17 00:00:00 2001 From: Oliver Date: Sun, 6 May 2018 20:30:17 +1000 Subject: [PATCH] Add more modal form funcs - Function to set the button text --- InvenTree/static/script/modal_form.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/InvenTree/static/script/modal_form.js b/InvenTree/static/script/modal_form.js index 28a1a46df1..931f1e8d6d 100644 --- a/InvenTree/static/script/modal_form.js +++ b/InvenTree/static/script/modal_form.js @@ -1,3 +1,7 @@ +function makeOption(id, title) { + return ""; +} + function attachSelect(modal) { // Attach to any 'select' inputs on the modal @@ -53,6 +57,10 @@ function modalSetContent(modal, content='') { $(modal).find('.modal-form-content').html(content); } +function modalSetButtonText(modal, text) { + $(modal).find("#modal-form-submit").html(text); +} + function openModal(modal, title='', content='') { @@ -212,7 +220,7 @@ function launchModalForm(modal, url, options = {}) { } if (response.submit_text) { - $(modal + ' #modal-form-submit').html(response.submit_text); + modalSetButtonText(response.submit_text); } if (response.html_form) {