PluginProbe
Booking Calendar / 11.9
Booking Calendar v11.9
11.9 11.8.4 11.8.3 11.8.2 11.8.1 11.8 11.7 11.6.1 11.6 11.5 11.4.3 11.4.2 11.4.1 11.4 11.3 11.2.1 11.2 11.1 11.0 10.15.7 10.15.6 10.1.3 10.10 10.10.1 10.10.2 All 205 releases
← All changes | js/wpbc-free-date-hints.js +15 -11 11.1 → 11.9 View file →
@@ -1,4 +1,4 @@
1 1 /**
2 2 * Free date hints runtime.
3 3 *
4 4 * Mirrors the public Pro cost-hint trigger names when they are not already
@@ -57,12 +57,11 @@
57 57
58 58 if (
59 59 'undefined' !== typeof _wpbc &&
60 60 'dynamic' === _wpbc.calendar__get_param_value( resourceId, 'days_select_mode' )
61 - ) {
62 - inst = ( typeof w.wpbc_calendar__get_inst === 'function' ) ? w.wpbc_calendar__get_inst( resourceId ) : null;
63 - $( '.wpbc_select_check_out_date_message' ).remove();
64 - if ( null !== inst && inst.stayOpen === true ) {
61 + ) {
62 + inst = ( typeof w.wpbc_calendar__get_inst === 'function' ) ? w.wpbc_calendar__get_inst( resourceId ) : null;
63 + if ( null !== inst && inst.stayOpen === true ) {
65 64 $( '.wpbc_free_date_hint' ).html( '...' );
66 65 return false;
67 66 }
68 67 }
@@ -139,15 +138,20 @@
139 138 };
140 139 }
141 140
142 141 $( function () {
143 - $( 'body' ).on( 'wpbc_calendar_ajx__loaded_data', function ( event, loadedResourceId ) {
144 - w.wpbc_show_cost_hints_after_few_seconds( loadedResourceId );
145 - } );
146 -
147 - $( '.booking_form_div' ).on( 'date_selected', function ( event, resourceId ) {
148 - w.wpbc_show_cost_hints_after_few_seconds( resourceId );
149 - } );
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 + );
150 154
151 155 $( document ).on( 'change', '.booking_form_div input, .booking_form_div select, .booking_form_div textarea', function () {
152 156 var form = $( this ).closest( 'form.booking_form' ),
153 157 resourceId;