From b653b742ede0e6d30ebb4ec03b8cbb2e0f993478 Mon Sep 17 00:00:00 2001 From: Ashesh Vashi Date: Tue, 24 Apr 2018 18:57:31 +0530 Subject: [PATCH] Close button added to the alertify message box, which pops up in case of backend error. Fixes #3290 --- .../browser/server_groups/servers/static/js/server.js | 7 ++++--- web/pgadmin/browser/static/js/error.js | 2 +- web/pgadmin/static/js/alertify.pgadmin.defaults.js | 9 ++++++--- web/pgadmin/tools/datagrid/static/js/datagrid.js | 2 ++ web/pgadmin/tools/sqleditor/static/js/sqleditor.js | 1 + 5 files changed, 14 insertions(+), 7 deletions(-) diff --git a/web/pgadmin/browser/server_groups/servers/static/js/server.js b/web/pgadmin/browser/server_groups/servers/static/js/server.js index 302fe4588..375b0b633 100644 --- a/web/pgadmin/browser/server_groups/servers/static/js/server.js +++ b/web/pgadmin/browser/server_groups/servers/static/js/server.js @@ -420,10 +420,10 @@ define('pgadmin.node.server', [ return { buttons: [{ text: gettext('Ok'), key: 13, className: 'btn btn-primary', - attrs:{name:'submit'}, + attrs: {name:'submit'}, },{ - text: gettext('Cancel'), key: 27, className: 'btn btn-danger', - attrs:{name:'cancel'}, + text: gettext('Cancel'), key: 27, + className: 'btn btn-danger', attrs: {name: 'cancel'}, }], // Set options for dialog options: { @@ -1046,6 +1046,7 @@ define('pgadmin.node.server', [ text: gettext('OK'), key: 13, className: 'btn btn-primary', },{ text: gettext('Cancel'), className: 'btn btn-danger', + key: 27, }], focus: {element: '#password', select: true}, options: { diff --git a/web/pgadmin/browser/static/js/error.js b/web/pgadmin/browser/static/js/error.js index 6066ff03f..31b7444a1 100644 --- a/web/pgadmin/browser/static/js/error.js +++ b/web/pgadmin/browser/static/js/error.js @@ -37,7 +37,7 @@ function(gettext, _, alertify, pgAdmin) { alertify.alert( title, text - ); + ).set('closable', true); }, }); diff --git a/web/pgadmin/static/js/alertify.pgadmin.defaults.js b/web/pgadmin/static/js/alertify.pgadmin.defaults.js index 0d754ceac..cf2dd1644 100644 --- a/web/pgadmin/static/js/alertify.pgadmin.defaults.js +++ b/web/pgadmin/static/js/alertify.pgadmin.defaults.js @@ -21,9 +21,10 @@ define([ setup: function() { return { options: { - //disable both padding and overflow control. + // Disable both padding and overflow control. padding: !1, overflow: !1, + closable: true, }, }; }, @@ -127,13 +128,15 @@ define([ return; } } catch (e) { - alertify.alert().show().set('message', e.message).set('title', 'Error'); + alertify.alert().show().set('message', e.message).set( + 'title', 'Error' + ).set('closable', true); } } } alertify.alert().show().set( 'message', msg.replace(new RegExp(/\r?\n/, 'g'), '
') - ).set('title', promptmsg); + ).set('title', promptmsg).set('closable', true); }; var alertifyDialogResized = function(stop) { diff --git a/web/pgadmin/tools/datagrid/static/js/datagrid.js b/web/pgadmin/tools/datagrid/static/js/datagrid.js index 473f20ad9..b0ed60f6d 100644 --- a/web/pgadmin/tools/datagrid/static/js/datagrid.js +++ b/web/pgadmin/tools/datagrid/static/js/datagrid.js @@ -286,10 +286,12 @@ define('pgadmin.datagrid', [ return { buttons:[{ text: gettext('OK'), + key: 13, className: 'btn btn-primary', }, { text: gettext('Cancel'), + key: 27, className: 'btn btn-danger', }, ], diff --git a/web/pgadmin/tools/sqleditor/static/js/sqleditor.js b/web/pgadmin/tools/sqleditor/static/js/sqleditor.js index 49e41b369..f95389c65 100644 --- a/web/pgadmin/tools/sqleditor/static/js/sqleditor.js +++ b/web/pgadmin/tools/sqleditor/static/js/sqleditor.js @@ -1749,6 +1749,7 @@ define('tools.querytool', [ }, { text: gettext('Cancel'), + key: 27, className: 'btn btn-danger', }, ],