From e522ebbccaf699d93b57cd2a9b8a988b4165722c Mon Sep 17 00:00:00 2001 From: Khushboo Vashi Date: Fri, 6 May 2016 15:47:21 +0100 Subject: [PATCH] Ensure delete/drop works without JS errors. --- web/pgadmin/browser/templates/browser/js/node.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/web/pgadmin/browser/templates/browser/js/node.js b/web/pgadmin/browser/templates/browser/js/node.js index 8779a005d..38f272225 100644 --- a/web/pgadmin/browser/templates/browser/js/node.js +++ b/web/pgadmin/browser/templates/browser/js/node.js @@ -89,7 +89,7 @@ function($, _, S, pgAdmin, Menu, Backbone, Alertify, pgBrowser, Backform) { applies: ['object', 'context'], callback: 'delete_obj', priority: 3, label: '{{ _("Delete/Drop") }}', data: {'url': 'drop'}, icon: 'fa fa-trash', - enable: _.isFunction(self.canDrop) ? function() { return self.canDrop.apply(self, arguments); } : false + enable: _.isFunction(self.canDrop) ? !!self.canDrop.apply(self, arguments) : (!!self.canDrop) }]); if (self.canDropCascade) { pgAdmin.Browser.add_menus([{ @@ -97,8 +97,8 @@ function($, _, S, pgAdmin, Menu, Backbone, Alertify, pgBrowser, Backform) { applies: ['object', 'context'], callback: 'delete_obj', priority: 3, label: '{{ _("Drop Cascade") }}', data: {'url': 'delete'}, icon: 'fa fa-trash', - enable: (_.isFunction(self.canDropCascade) ? - function() { return self.canDropCascade.apply(self, arguments); } : true) + enable: _.isFunction(self.canDropCascade) ? + function() { return self.canDropCascade.apply(self, arguments); } : (!!self.canDropCascade) }]); } }