mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2024-11-25 10:10:19 -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',
|
applies: ['object', 'context'], callback: 'delete_obj',
|
||||||
priority: 3, label: '{{ _("Delete/Drop") }}',
|
priority: 3, label: '{{ _("Delete/Drop") }}',
|
||||||
data: {'url': 'drop'}, icon: 'fa fa-trash',
|
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) {
|
if (self.canDropCascade) {
|
||||||
pgAdmin.Browser.add_menus([{
|
pgAdmin.Browser.add_menus([{
|
||||||
@ -97,8 +97,8 @@ function($, _, S, pgAdmin, Menu, Backbone, Alertify, pgBrowser, Backform) {
|
|||||||
applies: ['object', 'context'], callback: 'delete_obj',
|
applies: ['object', 'context'], callback: 'delete_obj',
|
||||||
priority: 3, label: '{{ _("Drop Cascade") }}',
|
priority: 3, label: '{{ _("Drop Cascade") }}',
|
||||||
data: {'url': 'delete'}, icon: 'fa fa-trash',
|
data: {'url': 'delete'}, icon: 'fa fa-trash',
|
||||||
enable: (_.isFunction(self.canDropCascade) ?
|
enable: _.isFunction(self.canDropCascade) ?
|
||||||
function() { return self.canDropCascade.apply(self, arguments); } : true)
|
function() { return self.canDropCascade.apply(self, arguments); } : (!!self.canDropCascade)
|
||||||
}]);
|
}]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user