Permalink
Browse files

MINOR Fixed GridField delete action, was executing row click event af…

…ter delete, causing a panel load with a non-existent (now deleted) record
  • Loading branch information...
1 parent 4253950 commit a5b7a22a05fbf3205f12e6fc03797c5d8a31ec52 @chillu chillu committed Mar 6, 2012
Showing with 9 additions and 5 deletions.
  1. +9 −5 javascript/GridField.js
@@ -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');
@@ -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);
+ }
}
});

0 comments on commit a5b7a22

Please sign in to comment.