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 | includes/__js/client/cal/days_select_custom.js +34 -4 11.3 → 11.9 View file →
@@ -1,4 +1,4 @@
1 1 /**
2 2 * ====================================================================================================================
3 3 * includes/__js/cal/days_select_custom.js
4 4 * ====================================================================================================================
@@ -152,12 +152,42 @@
152 152 wpbc_cal_days_select__re_init( resource_id );
153 153 wpbc_cal__re_init( resource_id );
154 154 }
155 155
156 -// ---------------------------------------------------------------------------------------------------------------------
157 -
158 -/**
159 - * Set Range Days selection with 2 mouse clicks - after page load
156 +// ---------------------------------------------------------------------------------------------------------------------
157 +
158 +/**
159 + * Set the existing calendar parameters to two-click range mode after page load.
160 + * Free uses the unrestricted shared handler; Business Small+ keeps its already initialized advanced range rules.
161 + *
162 + * @param resource_id ID of booking resource.
163 + */
164 +function wpbc_cal_ready_days_select__range_mode( resource_id ){
165 +
166 + jQuery(document).ready(function(){
167 + setTimeout(function(){
168 + wpbc_cal_days_select__range_mode( resource_id );
169 + }, 1000);
170 + });
171 +}
172 +
173 +/**
174 + * Switch to two-click range mode without changing any advanced range parameters.
175 + *
176 + * @param resource_id ID of booking resource.
177 + */
178 +function wpbc_cal_days_select__range_mode( resource_id ){
179 +
180 + _wpbc.calendar__set_parameters( resource_id, {'days_select_mode': 'dynamic'} );
181 +
182 + wpbc_cal_days_select__re_init( resource_id );
183 + wpbc_cal__re_init( resource_id );
184 +}
185 +
186 +// ---------------------------------------------------------------------------------------------------------------------
187 +
188 +/**
189 + * Set Range Days selection with 2 mouse clicks - after page load
160 190 *
161 191 * @integer resource_id - 1 -- ID of booking resource (calendar)
162 192 * @integer days_min - 7 -- Min number of days to select
163 193 * @integer days_max - 30 -- Max number of days to select