Skip to content

Commit

Permalink
MINOR Fixed GridField delete action, was executing row click event af…
Browse files Browse the repository at this point in the history
…ter delete, causing a panel load with a non-existent (now deleted) record
  • Loading branch information
chillu committed Mar 6, 2012
1 parent 4253950 commit a5b7a22
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions javascript/GridField.js
Expand Up @@ -71,9 +71,9 @@

$('.ss-gridfield .ss-gridfield-item').entwine({
onclick: function(e) {
if($(e.target).is('.action')) {
if($(e.target).closest('.action').length) {
this._super(e);
return;
return false;
}

var editLink = this.find('.edit-link');
Expand All @@ -94,10 +94,14 @@
}
});

$('.ss-gridfield .gridfield-button-delete').entwine({
$('.ss-gridfield .action.gridfield-button-delete').entwine({
onclick: function(e){
if(!confirm(ss.i18n._t('TABLEFIELD.DELETECONFIRMMESSAGE'))) return false;
else this._super(e);
if(!confirm(ss.i18n._t('TABLEFIELD.DELETECONFIRMMESSAGE'))) {
e.preventDefault();
return false;
} else {
this._super(e);
}
}
});

Expand Down

0 comments on commit a5b7a22

Please sign in to comment.