FIX: Make sure inline adding to correct GridField

I work with nested GridFields, and without this the inline button adds to all GridFields that are nested within one.
This commit is contained in:
mi3ll 2015-02-13 13:50:44 +11:00 committed by Mellisa Hankins
parent 4855ac5ec0
commit a073707162

View File

@ -90,7 +90,10 @@
if(success) success.apply(grid, arguments); if(success) success.apply(grid, arguments);
}); });
}, },
onaddnewinline: function() { onaddnewinline: function(e) {
if(e.target != this[0])
return;
var tmpl = window.tmpl; var tmpl = window.tmpl;
var row = this.find(".ss-gridfield-add-inline-template"); var row = this.find(".ss-gridfield-add-inline-template");
var num = this.data("add-inline-num") || 1; var num = this.data("add-inline-num") || 1;