Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I have hacked it a little so that msDropDown() only get's attached once.
I did
$('#edit-lang-dropdown-select:not(.processed)').addClass('processed').msDropDown({
inside lang_dropdown.js
Comment | File | Size | Author |
---|---|---|---|
#1 | lang_dropdown-ajax_issues-1699776-1-D7.patch | 3.79 KB | lmeurs |
Comments
Comment #1
lmeurs CreditAttribution: lmeurs commentedThere are multiple problems when AJAX is being used (or better: behaviors are being attached) on the same page with a Language Switcher Dropdown.
See patch attached for Drupal 7 which added context to jQuery queries and sets an initialized flag on the
element.
Comment #2
hcderaad CreditAttribution: hcderaad commentedI can confirm the patch from #1 to work with AJAX requests in separate view on the same page. Thanks @lmeurs
Comment #3
hcderaad CreditAttribution: hcderaad commentedSwitched status, tested and reviewed the patch from #1.
Comment #4
kala4ekComment #6
kala4ek