|
174 | 174 | * Create the div container, add an overlay so the user can interact |
175 | 175 | * with the form in Gutenberg, then render the iframe with form |
176 | 176 | */ |
177 | | - if( '' === formID ) { |
| 177 | + if( '' === formID ) { |
178 | 178 | children.push( el( 'div', {style : {width: '100%'}}, |
179 | 179 | el( 'img', { className: 'weforms-block-logo', src: weFormsBlock.block_logo}), |
180 | 180 | el ( 'div', null, 'weForms Forms'), |
181 | 181 | inputFilterMain |
182 | 182 | ) ); |
| 183 | + } else if( '0' === weFormsBlock.did_wp_head_run ) { |
| 184 | + children.push( |
| 185 | + el( 'div', { className: 'weforms-iframe-container' }, |
| 186 | + el( 'div', { className: 'weforms-iframe-overlay' } ), |
| 187 | + el( 'span', null, 'Currently weForm is not able to be previewed in the Block-Based page builder. To preview use the page preview button after saving.' ), |
| 188 | + ) |
| 189 | + ) |
183 | 190 | } else { |
184 | 191 | children.push( |
185 | 192 | el( 'div', { className: 'weforms-iframe-container' }, |
186 | 193 | el( 'div', { className: 'weforms-iframe-overlay' } ), |
187 | | - el( 'iframe', { src: weFormsBlock.siteUrl + '?weforms_preview=1&weforms_iframe&form_id=' + formID, height: '0', width: '500', scrolling: 'no' }) |
| 194 | + el( 'iframe', { src: weFormsBlock.siteUrl + '/?weforms_preview=1&weforms_iframe&form_id=' + formID, height: '0', width: '500', scrolling: 'no' }) |
188 | 195 | ) |
189 | 196 | ) |
190 | 197 | } |
|
0 commit comments