@@ -27,9 +27,6 @@ function FBAform(d, N) {
2727 } ,
2828 init : function ( options ) {
2929 this . javascriptIsEnabled ( ) ;
30- < % - if form . has_rich_text_questions ? % >
31- this . loadQuill ( ) ;
32- < % end % >
3330 this . options = options ;
3431 if ( this . options . loadCSS ) {
3532 this . _loadCss ( ) ;
@@ -38,6 +35,7 @@ function FBAform(d, N) {
3835 if ( ! this . options . suppressUI && ( this . options . deliveryMethod && this . options . deliveryMethod === 'modal' ) ) {
3936 this . loadButton ( ) ;
4037 }
38+ this . enableLocalStorage ( ) ;
4139 this . _bindEventListeners ( ) ;
4240 this . successState = false ; // initially false
4341 this . _pagination ( ) ;
@@ -47,7 +45,9 @@ function FBAform(d, N) {
4745 < % - if form . enable_turnstile ? % >
4846 this . loadTurnstile ( ) ;
4947 < % end % >
50- this.enableLocalStorage();
48+ < % - if form . has_rich_text_questions ? % >
49+ this.loadQuill();
50+ < % end % >
5151 d.dispatchEvent(new CustomEvent('onTouchpointsFormLoaded', {
5252 detail : {
5353 formComponent : this
@@ -692,6 +692,8 @@ function FBAform(d, N) {
692692 }
693693 } ) ;
694694
695+ quill . root . innerHTML = hiddenInput . value ; // Restore values
696+
695697 // Sync to hidden field on change
696698 quill . on ( 'text-change' , function ( ) {
697699 updateCount ( ) ;
@@ -702,9 +704,7 @@ function FBAform(d, N) {
702704 const html = quill . root . innerHTML ;
703705 countDisplay . textContent = "" + ( maxLimit - html . length ) + " <%= t :characters_left %>" ;
704706 } ;
705-
706707 }
707-
708708 } ) ;
709709 } ,
710710 < % end % >
0 commit comments