diff --git a/web/skins/classic/js/skin.js b/web/skins/classic/js/skin.js index 3268ccf05..c7e2afedf 100644 --- a/web/skins/classic/js/skin.js +++ b/web/skins/classic/js/skin.js @@ -781,7 +781,7 @@ function logAjaxFail(jqxhr, textStatus, error) { } // Load the Modal HTML via Ajax call -function getModal(id, parameters) { +function getModal(id, parameters, buttonconfig=null) { $j.getJSON(thisUrl + '?request=modal&modal='+id+'&'+parameters) .done(function(data) { if ( !data ) { @@ -790,7 +790,7 @@ function getModal(id, parameters) { } insertModalHtml(id, data.html); - manageModalBtns(id); + buttonconfig ? buttonconfig() : manageModalBtns(id); modal = $j('#'+id+'Modal'); if ( ! modal.length ) { console.log('No modal found'); @@ -800,6 +800,14 @@ function getModal(id, parameters) { .fail(logAjaxFail); } +function showModal(id, buttonconfig=null) { + var div = $j('#'+id+'Modal'); + if ( ! div.length ) { + getModal(id, buttonconfig); + } + div.modal('show'); +} + function manageModalBtns(id) { // Manage the CANCEL modal button, note data-dismiss="modal" would work better var cancelBtn = document.getElementById(id+"CancelBtn");