mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2024-11-22 00:37:36 -06:00
Ensure delete/drop works without JS errors.
This commit is contained in:
parent
f3d05279a7
commit
e522ebbcca
@ -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)
|
||||
}]);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user