src/demo/js/demo.js
function toggleEdit() {
    document.body.classList.toggle('form-rendered', editing)
    if (!editing) {
      $('.build-wrap').formBuilder('setData', $('.render-wrap').formRender('userData'))
    } else {
      const formRenderData = $('.build-wrap').formBuilder('getData', dataType)
      $('.render-wrap').formRender({
        formData: formRenderData,
        templates: templates,
        dataType,
      })
      window.sessionStorage.setItem('formData', formRenderData)
    }
    return (editing = !editing)
  }
function toggleEdit() {
    document.body.classList.toggle('form-rendered', editing)
    if (!editing) {
      $('.build-wrap').formBuilder('setData', $('.render-wrap').formRender('userData'))
    } else {
      const formRenderData = $('.build-wrap').formBuilder('getData', dataType)
      $('.render-wrap').formRender({
        formData: formRenderData,
        templates: templates,
        dataType,
      })
      window.sessionStorage.setItem('formData', formRenderData)
    }
    return (editing = !editing)
  }
function toggleEdit ( ) { document . body . classList . toggle ( 'form-rendered' , editing ) if ( ! editing ) { $ ( '.build-wrap' ) . formBuilder ( 'setData' , $ ( '.render-wrap' ) . formRender ( 'userData' ) ) } else { const formRenderData = $ ( '.build-wrap' ) . formBuilder ( 'getData' , dataType ) $ ( '.render-wrap' ) . formRender ( { formData : formRenderData , templates : templates , dataType , } ) window . sessionStorage . setItem ( 'formData' , formRenderData ) } return ( editing = ! editing ) }
Toggles the edit mode for the demo
@return {Boolean} editMode
Toggles the edit mode for the demo