src/js/form-builder.js
function(formData) {
    formData = h.getData(formData)
    if (formData && formData.length) {
      formData.forEach(fieldData => prepFieldVars(trimObj(fieldData)))
      d.stage.classList.remove('empty')
    } else if (opts.defaultFields && opts.defaultFields.length) {
      // Load default fields if none are set
      opts.defaultFields.forEach(field => prepFieldVars(field))
      d.stage.classList.remove('empty')
    } else if (!opts.prepend && !opts.append) {
      d.stage.classList.add('empty')
      d.stage.dataset.content = mi18n.get('getStarted')
    }

    if (nonEditableFields()) {
      d.stage.classList.remove('empty')
    }

    h.save()
  }
function(formData) {
    formData = h.getData(formData)
    if (formData && formData.length) {
      formData.forEach(fieldData => prepFieldVars(trimObj(fieldData)))
      d.stage.classList.remove('empty')
    } else if (opts.defaultFields && opts.defaultFields.length) {
      // Load default fields if none are set
      opts.defaultFields.forEach(field => prepFieldVars(field))
      d.stage.classList.remove('empty')
    } else if (!opts.prepend && !opts.append) {
      d.stage.classList.add('empty')
      d.stage.dataset.content = mi18n.get('getStarted')
    }

    if (nonEditableFields()) {
      d.stage.classList.remove('empty')
    }

    h.save()
  }
function ( formData ) { formData = h . getData ( formData ) if ( formData && formData . length ) { formData . forEach ( fieldData => prepFieldVars ( trimObj ( fieldData ) ) ) d . stage . classList . remove ( 'empty' ) } else if ( opts . defaultFields && opts . defaultFields . length ) { // Load default fields if none are set opts . defaultFields . forEach ( field => prepFieldVars ( field ) ) d . stage . classList . remove ( 'empty' ) } else if ( ! opts . prepend && ! opts . append ) { d . stage . classList . add ( 'empty' ) d . stage . dataset . content = mi18n . get ( 'getStarted' ) } if ( nonEditableFields ( ) ) { d . stage . classList . remove ( 'empty' ) } h . save ( ) }
Parse saved XML template data
Parse saved XML template data