| @@ -138,15 +138,20 @@ | ||
| 138 | 138 | }; |
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | $( function () { |
| 142 | - $( 'body' ).on( 'wpbc_calendar_ajx__loaded_data', function ( event, loadedResourceId ) { | |
| 143 | - w.wpbc_show_cost_hints_after_few_seconds( loadedResourceId ); | |
| 144 | - } ); | |
| 145 | - | |
| 146 | - $( '.booking_form_div' ).on( 'date_selected', function ( event, resourceId ) { | |
| 147 | - w.wpbc_show_cost_hints_after_few_seconds( resourceId ); | |
| 148 | - } ); | |
| 142 | + $( 'body' ).on( 'wpbc_calendar_ajx__loaded_data', function ( event, loadedResourceId ) { | |
| 143 | + w.wpbc_show_cost_hints_after_few_seconds( loadedResourceId ); | |
| 144 | + } ); | |
| 145 | + | |
| 146 | + // Resource Selector and other workflows can insert native forms after document readiness. | |
| 147 | + $( document ).on( | |
| 148 | + 'date_selected.wpbc_free_date_hints', | |
| 149 | + '.booking_form_div', | |
| 150 | + function ( event, resourceId ) { | |
| 151 | + w.wpbc_show_cost_hints_after_few_seconds( resourceId ); | |
| 152 | + } | |
| 153 | + ); | |
| 149 | 154 | |
| 150 | 155 | $( document ).on( 'change', '.booking_form_div input, .booking_form_div select, .booking_form_div textarea', function () { |
| 151 | 156 | var form = $( this ).closest( 'form.booking_form' ), |
| 152 | 157 | resourceId; |