Add more modal form funcs

- Function to set the button text
This commit is contained in:
Oliver 2018-05-06 20:30:17 +10:00
parent c2bc65f903
commit 87f96d6b3c

View File

@ -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) {