diff --git a/src/main/java/org/olat/core/commons/fullWebApp/_content/guimsg.html b/src/main/java/org/olat/core/commons/fullWebApp/_content/guimsg.html index 611103e7611ad96838ea62d9ce32a37d2ed1f80f..710cd728e5a4e0f4a9567b071211e4e97797cdfa 100644 --- a/src/main/java/org/olat/core/commons/fullWebApp/_content/guimsg.html +++ b/src/main/java/org/olat/core/commons/fullWebApp/_content/guimsg.html @@ -14,7 +14,7 @@ var dialog = showMessageBox("warn", "$r.translate("warn.header")", "$r.get("guiMessage").renderWarn()"); setTimeout(function(){ try { - jQuery(dialog).dialog('destroy').remove(); + jQuery(dialog).modal('hide'); } catch(e) { //possible if the user has closed the window } diff --git a/src/main/webapp/static/js/functions.js b/src/main/webapp/static/js/functions.js index 65c7e6191974293d203fbf2fcabb1cfdb2721c20..86e3b206d68924f938f594a70fe8e2cc92333ddd 100644 --- a/src/main/webapp/static/js/functions.js +++ b/src/main/webapp/static/js/functions.js @@ -1121,32 +1121,28 @@ function showInfoBox(title, content){ * The last parameter buttonCallback is optional. if a callback js * function is given it will be execute when the user clicks ok or closes the message box */ -function showMessageBox(type, title, message, buttonCallback){ +function showMessageBox(type, title, message, buttonCallback) { if(type == 'info'){ showInfoBox(title, message); return null; } else { - var prefix; + var content = '<div id="myFunctionalModal" class="modal fade" role="dialog"><div class="modal-dialog"><div class="modal-content">'; + content += '<div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>'; + content += '<h4 class="modal-title">' + title + '</h4></div>'; + content += '<div class="modal-body alert '; if("warn" == type) { - prefix = '<div><div class="alert alert-warning">'; + content += 'alert-warning'; } else if("error" == type) { - prefix = '<div><div class="alert alert-danger">'; + content += 'alert-danger'; } else { - prefix = '<div><div class="alert alert-info">'; + content += 'alert-info'; } - return jQuery(prefix + '<p>' + message + '</p></div></div>').dialog({ - modal: true, - title: title, - resizable:false, - close: function(event, ui) { - try { - jQuery(this).dialog('destroy').remove() - } catch(e) { - //possible if the user has closed the window - } - } - }).dialog('open').dialog("widget").css('z-index', 11000); - + content += '"><p>' + message + '</p></div></div></div></div>'; + jQuery('#myFunctionalModal').remove(); + jQuery('body').append(content); + return jQuery('#myFunctionalModal').modal('show').on('hidden.bs.modal', function (e) { + jQuery('#myFunctionalModal').remove(); + }); } }