forked from 0x2620/pandora
fix #1647 (add 'View Error Logs...' button to bottom left of error dialog, if applicable)
This commit is contained in:
parent
6015528f8e
commit
d6d44f2878
1 changed files with 18 additions and 3 deletions
|
@ -2,7 +2,8 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
pandora.ui.errorDialog = function(data) {
|
pandora.ui.errorDialog = function(data) {
|
||||||
var that, error;
|
|
||||||
|
var that, error, showLogsButton;
|
||||||
|
|
||||||
//dont open dialog on unload or if antoher error is open
|
//dont open dialog on unload or if antoher error is open
|
||||||
//fixme: error dialog should updated instead
|
//fixme: error dialog should updated instead
|
||||||
|
@ -36,8 +37,22 @@ pandora.ui.errorDialog = function(data) {
|
||||||
// in order to keep the dialog from appearing, delay it
|
// in order to keep the dialog from appearing, delay it
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
if ($('.OxErrorDialog').length == 0 && !pandora.isUnloading) {
|
if ($('.OxErrorDialog').length == 0 && !pandora.isUnloading) {
|
||||||
|
showLogsButton = error == 'error'
|
||||||
|
&& pandora.site.capabilities.canSeeDebugMenu[pandora.user.level]
|
||||||
that = pandora.ui.iconDialog({
|
that = pandora.ui.iconDialog({
|
||||||
buttons: [
|
buttons: (showLogsButton ? [
|
||||||
|
Ox.Button({
|
||||||
|
id: 'close',
|
||||||
|
title: Ox._('View Error Logs...')
|
||||||
|
})
|
||||||
|
.bindEvent({
|
||||||
|
click: function() {
|
||||||
|
that.close();
|
||||||
|
pandora.$ui.logsDialog = pandora.ui.logsDialog().open();
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
{}
|
||||||
|
] : []).concat([
|
||||||
Ox.Button({
|
Ox.Button({
|
||||||
id: 'close',
|
id: 'close',
|
||||||
title: Ox._('Close')
|
title: Ox._('Close')
|
||||||
|
@ -47,7 +62,7 @@ pandora.ui.errorDialog = function(data) {
|
||||||
that.close();
|
that.close();
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
],
|
]),
|
||||||
keys: {enter: 'close', escape: 'close'},
|
keys: {enter: 'close', escape: 'close'},
|
||||||
text: Ox._('Sorry, a server {0}'
|
text: Ox._('Sorry, a server {0}'
|
||||||
+ ' occured while handling your request.'
|
+ ' occured while handling your request.'
|
||||||
|
|
Loading…
Reference in a new issue