Follow-up from #2145081: Duplicate id #rooms-wrapper.
If you have a case where you need different availability searches on a page, as soon as you embed more than one, the date pickers start to act funky.
This is because we have hardcoded the datepicker ids into the javascript.
We need to refactor this to pass a unique datepicker ajax id for each set of pickers to the javascript via eg, a Drupal.settings.rooms.datepickers
parameter.
This would also allow us to refactor the duplicate code in /js/rooms_date_popup.js and /modules/rooms_availability/rooms_availability_date_popup.js (which also collides if they were both to ever be added to the same page).
Comment | File | Size | Author |
---|---|---|---|
#3 | rooms-prevent-js-datepicker-collisions-2151565.patch | 11.1 KB | jwilson3 |
Comments
Comment #1
jwilson3Comment #2
jwilson3Comment #3
jwilson3Comment #4
jwilson3I've fixed this in master branch, but have included a patch here, in case someone wants to have a look.
Comment #5
jwilson3There is more work that needs to be done here. Looks like we need to properly expose configurations like core does it elsewhere using
#datepicker_options
.See #2046177: Use #datepicker_options to pass settings to Rooms date popups which should be considered a follow-up to this issue.
Comment #6
jwilson3I think i'll revert this to RTBC until we've had a chance to actually push this change out to drupal.org.
Comment #7
ItangSanjana CreditAttribution: ItangSanjana commentedI will soon report back after trying this. Thanks!
Comment #8
jwilson3Comment #10
jwilson3This is now fixed in 7.x-1.1