From: Coleman Watts Date: Wed, 30 Oct 2019 22:18:31 +0000 (-0400) Subject: Remove convertTextNodes X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=2201c50252e379936a0eff2b2d97b99264a8d03f;p=civicrm-core.git Remove convertTextNodes The api now returns them as an array so we don't need to worry about this on the client side. --- diff --git a/ext/afform/gui/ang/afGuiEditor.js b/ext/afform/gui/ang/afGuiEditor.js index fc4c72231f..d5b38680d9 100644 --- a/ext/afform/gui/ang/afGuiEditor.js +++ b/ext/afform/gui/ang/afGuiEditor.js @@ -47,7 +47,6 @@ $scope.afform = afform; $scope.layout = getTags($scope.afform.layout, 'af-form')[0]; evaluate($scope.layout['#children']); - convertTextNodes($scope.layout['#children']); $scope.entities = getTags($scope.layout['#children'], 'af-entity', 'name'); $scope.fields = getAllFields($scope.layout['#children']); } @@ -121,21 +120,6 @@ }); } - function convertTextNodes(collection) { - // Empty text nodes... just delete them. - _.remove(collection, function(item) { - return !item || (_.isString(item) && !_.trim(item)); - }); - // Convert other text nodes to objects - _.each(collection, function(item, idx) { - if (_.isPlainObject(item) && item['#children']) { - convertTextNodes(item['#children']); - } else if (_.isString(item)) { - collection[idx] = {'#text': item}; - } - }); - } - } }; });