From 434c63b7e3db6177b666899dfc864a686ebbf8da Mon Sep 17 00:00:00 2001 From: Roxanne Skelly Date: Wed, 25 Sep 2019 14:14:29 -0700 Subject: [PATCH] BUGZ-1381 - domain server creates blank/undefined group when adding groups --- domain-server/resources/web/js/base-settings.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/domain-server/resources/web/js/base-settings.js b/domain-server/resources/web/js/base-settings.js index 295013878c..d3f5baa2f9 100644 --- a/domain-server/resources/web/js/base-settings.js +++ b/domain-server/resources/web/js/base-settings.js @@ -250,14 +250,14 @@ $(document).ready(function(){ // set focus to the first input in the new row $target.closest('table').find('tr.inputs input:first').focus(); - } + } else { + var tableRows = sibling.parent(); + var tableBody = tableRows.parent(); - var tableRows = sibling.parent(); - var tableBody = tableRows.parent(); - - // if theres no more siblings, we should jump to a new row - if (sibling.next().length == 0 && tableRows.nextAll().length == 1) { - tableBody.find("." + Settings.ADD_ROW_BUTTON_CLASS).click(); + // if theres no more siblings, we should jump to a new row + if (sibling.next().length == 0 && tableRows.nextAll().length == 1) { + tableBody.find("." + Settings.ADD_ROW_BUTTON_CLASS).click(); + } } }