From 2201c50252e379936a0eff2b2d97b99264a8d03f Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Wed, 30 Oct 2019 18:18:31 -0400 Subject: [PATCH] Remove convertTextNodes The api now returns them as an array so we don't need to worry about this on the client side. --- ext/afform/gui/ang/afGuiEditor.js | 16 ---------------- 1 file changed, 16 deletions(-) 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}; - } - }); - } - } }; }); -- 2.25.1