mirror of
https://github.com/symbiote/silverstripe-gridfieldextensions.git
synced 2024-10-22 17:05:39 +02:00
FIX: Making sure it only removes/reloads the current GridField, not nested ones
This commit is contained in:
parent
a073707162
commit
29769cc5cc
@ -79,12 +79,12 @@
|
|||||||
$(".ss-gridfield.ss-gridfield-editable").entwine({
|
$(".ss-gridfield.ss-gridfield-editable").entwine({
|
||||||
reload: function(opts, success) {
|
reload: function(opts, success) {
|
||||||
var grid = this;
|
var grid = this;
|
||||||
var added = grid.find(".ss-gridfield-inline-new").detach();
|
var added = grid.find("tbody:first").find(".ss-gridfield-inline-new").detach();
|
||||||
|
|
||||||
this._super(opts, function() {
|
this._super(opts, function() {
|
||||||
if(added.length) {
|
if(added.length) {
|
||||||
added.appendTo(grid.find("tbody"));
|
added.appendTo(grid.find("tbody:first"));
|
||||||
grid.find(".ss-gridfield-no-items").hide();
|
grid.find("tbody:first").children(".ss-gridfield-no-items").hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(success) success.apply(grid, arguments);
|
if(success) success.apply(grid, arguments);
|
||||||
@ -118,7 +118,7 @@
|
|||||||
var msg = ss.i18n._t("GridFieldExtensions.CONFIRMDEL", "Are you sure you want to delete this?");
|
var msg = ss.i18n._t("GridFieldExtensions.CONFIRMDEL", "Are you sure you want to delete this?");
|
||||||
|
|
||||||
if(confirm(msg)) {
|
if(confirm(msg)) {
|
||||||
this.parents("tr").remove();
|
this.parents(".ss-gridfield-inline-new:first").remove();
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user