diff --git a/frontend-js/src/main/js/GuiConnector.js b/frontend-js/src/main/js/GuiConnector.js index 1d1aa5ad8a8fcfcd0c7b5ec7c751004e4abdb74a..b2843370fb61699f07d027acc458f04132e5efd5 100644 --- a/frontend-js/src/main/js/GuiConnector.js +++ b/frontend-js/src/main/js/GuiConnector.js @@ -296,7 +296,23 @@ GuiConnector.prototype.alert = function (error, redirectIfSecurityError) { var errorData = self.getErrorMessageForError(error); if (!errorData.showReport) { - + // legacy dialog (no report) + self._errorDialog = document.createElement("div"); + self._errorDialogContent = document.createElement("div"); + self._errorDialog.appendChild(self._errorDialogContent); + document.body.appendChild(self._errorDialog); + $(self._errorDialog).dialog({ + classes: { + "ui-dialog": "ui-state-error" + }, + modal: true, + title: "ERROR", + close: function() { + $(this).dialog('destroy').remove(); + } + }).siblings('.ui-dialog-titlebar').css("background", "red"); + self._errorDialogContent.innerHTML = errorData.message; + $(self._errorDialog).dialog("open"); } else { self._errorDialog = document.createElement('div'); self._errorDialog.innerHTML = '<span class="ui-icon ui-icon-info" style="float: right;" title="The error message. This might not be human readable. If this issue persists you should should contact your administrator."></span>' + @@ -338,6 +354,9 @@ GuiConnector.prototype.alert = function (error, redirectIfSecurityError) { height: 'auto', width: '500px', modal: true, + close: function() { + $(this).dialog('destroy').remove(); + }, buttons: { 'Submit': function () { var report = { @@ -351,10 +370,10 @@ GuiConnector.prototype.alert = function (error, redirectIfSecurityError) { } }); ServerConnector.submitErrorToMinervaNet(report); - $(this).dialog('destroy').remove(); + $(this).dialog('close'); }, 'Cancel': function () { - $(this).dialog('destroy').remove(); + $(this).dialog('close'); } } }).dialog("open");