From a073707162c4139a69e74f825bc92e7908f23b69 Mon Sep 17 00:00:00 2001 From: mi3ll Date: Fri, 13 Feb 2015 13:50:44 +1100 Subject: [PATCH] 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. --- javascript/GridFieldExtensions.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/javascript/GridFieldExtensions.js b/javascript/GridFieldExtensions.js index fbfe90c..d4627dc 100644 --- a/javascript/GridFieldExtensions.js +++ b/javascript/GridFieldExtensions.js @@ -90,7 +90,10 @@ if(success) success.apply(grid, arguments); }); }, - onaddnewinline: function() { + onaddnewinline: function(e) { + if(e.target != this[0]) + return; + var tmpl = window.tmpl; var row = this.find(".ss-gridfield-add-inline-template"); var num = this.data("add-inline-num") || 1;