Afform Gui - Fix html preview to use complete form
authorColeman Watts <coleman@civicrm.org>
Fri, 29 Jan 2021 03:49:31 +0000 (22:49 -0500)
committerColeman Watts <coleman@civicrm.org>
Sat, 30 Jan 2021 01:41:06 +0000 (20:41 -0500)
ext/afform/admin/ang/afGuiEditor/afGuiEditor.component.js

index 4cbe9a44f2a3999300d8591ae5b99fa1f5bc1cb9..288a4bb503e6dcbca6508315759015b68ceb29f8 100644 (file)
@@ -75,7 +75,7 @@
 
       $scope.updateLayoutHtml = function() {
         $scope.layoutHtml = '...Loading...';
-        crmApi4('Afform', 'convert', {layout: [editor.layout], from: 'deep', to: 'html', formatWhitespace: true})
+        crmApi4('Afform', 'convert', {layout: $scope.afform.layout, from: 'deep', to: 'html', formatWhitespace: true})
           .then(function(r){
             $scope.layoutHtml = r[0].layout || '(Error)';
           })