MINOR Fixed overloaded delete confirmations in AssetAdmin.js

This commit is contained in:
Ingo Schommer 2012-03-08 17:26:34 +01:00
parent f085583b61
commit 953e2bd1c7

View File

@ -28,10 +28,10 @@
* Load folder detail view via controller methods
* rather than built-in GridField view (which is only geared towards showing files).
*/
$('#Form_EditForm_File .ss-gridfield-item').entwine({
$('.AssetAdmin.cms-edit-form .ss-gridfield-item').entwine({
onclick: function(e) {
// Let actions do their own thing
if($(e.target).is('.action')) {
if($(e.target).closest('.action').length) {
this._super(e);
return;
}
@ -45,7 +45,17 @@
}
});
$('.cms-edit-form :submit[name=action_delete]').entwine({
$('.AssetAdmin.cms-edit-form .action.gridfield-button-delete').entwine({
onclick: function(e) {
if(!confirm(ss.i18n._t('AssetAdmin.ConfirmDelete'))) return false;
this.getGridField().reload({data: [{name: this.attr('name'), value: this.val()}]});
e.preventDefault();
return false;
}
});
$('.AssetAdmin.cms-edit-form :submit[name=action_delete]').entwine({
onclick: function(e) {
if(!confirm(ss.i18n._t('AssetAdmin.ConfirmDelete'))) return false;
else this._super(e);