initElementor.js
17 lines
| 1 | import initForm from './initForm'; |
| 2 | |
| 3 | function initElementor() { |
| 4 | if ( ! window.elementorFrontend ) { |
| 5 | return; |
| 6 | } |
| 7 | const widgets = { |
| 8 | 'jet-engine-booking-form.default': initForm, |
| 9 | 'jet-form-builder-form.default': initForm, |
| 10 | }; |
| 11 | |
| 12 | jQuery.each( widgets, function( widget, callback ) { |
| 13 | window.elementorFrontend.hooks.addAction( 'frontend/element_ready/' + widget, callback ); |
| 14 | } ); |
| 15 | } |
| 16 | |
| 17 | export default initElementor; |