Remove convertTextNodes
authorColeman Watts <coleman@civicrm.org>
Wed, 30 Oct 2019 22:18:31 +0000 (18:18 -0400)
committerCiviCRM <info@civicrm.org>
Wed, 16 Sep 2020 02:13:19 +0000 (19:13 -0700)
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

index fc4c72231f9b3ba81e87979aa53fefd66fcc303a..d5b38680d962fa16e5e3fa2d0184f2f8853691b3 100644 (file)
@@ -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']);
         }
           });
         }
 
-        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};
-            }
-          });
-        }
-
       }
     };
   });