From 83518a3078e7454a76f53b3ea2f36177ae7426f2 Mon Sep 17 00:00:00 2001 From: Cameron Date: Wed, 14 Dec 2022 14:24:08 -0800 Subject: [PATCH] Fixes #4923 - data-modal-submit attribute. Also setting data-modal-close to 'false' will hide the close button in the modal window footer. --- e107_web/js/core/admin.jquery.js | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/e107_web/js/core/admin.jquery.js b/e107_web/js/core/admin.jquery.js index 4b46aa6b4..89faefdd3 100644 --- a/e107_web/js/core/admin.jquery.js +++ b/e107_web/js/core/admin.jquery.js @@ -42,17 +42,34 @@ var e107 = e107 || {'settings': {}, 'behaviors': {}}; target = '#uiModal'; } + if($this.attr('data-modal-close') === 'false') + { + $(target+' .modal-footer button[data-dismiss="modal"]').hide(); + } + $(target+' .modal-body').html('
'); $(target+' .modal-caption').html(caption + ' '); $(target+'.modal').modal('show'); + + $("#e-modal-iframe").on("load", function () { $('#e-modal-loading').hide(); + + if($this.attr('data-modal-submit')) { - var buttonCaption = $('#e-modal-iframe').contents().find('#etrigger-submit').text(); // copy submit button caption from iframe form. + var buttonObj = $('#e-modal-iframe').contents().find('#etrigger-submit'); + var buttonCaption = buttonObj.text(); // copy submit button caption from iframe form. + + if(buttonObj.val()) + { + buttonCaption = buttonObj.val(); // copy when it's an