Fix directory type nav click scope#2865
Open
Arafat-plugins wants to merge 1 commit into
Open
Conversation
Collaborator
|
Looks Good @Arafat-plugins
|
Contributor
Author
ok |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Type
What kind of change does this PR introduce?
Description
How to reproduce the issue or how to test the changes
This fixes Directorist directory type navigation clicks being intercepted by the search form listing type AJAX handler.
The search form script was binding the
atbdp_listing_types_formAJAX handler to both.search_listing_typesand the global.directorist-type-nav__linkselector. Category and location directory type navigation also use.directorist-type-nav__link, so clicking Buy/Rent on those taxonomy pages could be prevented from following the normal URL and instead trigger the search form AJAX request.This change scopes the AJAX click handler to links inside
.directorist-search-contents, keeping the search form type switcher behavior intact while allowing category and location nav links to follow their normaldirectory_typeURLs./categories/.Rentor another directory type nav item./categories/?directory_type=rentinstead of firingadmin-ajax.php?action=atbdp_listing_types_form./locations/.Rentor another directory type nav item./locations/?directory_type=rentinstead of firingadmin-ajax.php?action=atbdp_listing_types_form.atbdp_listing_types_formAJAX request.Any linked issues
Fixes # https://taiga-sovware-u10698.vm.elestio.app/project/directorist/issue/2940
Screenshot
Checklist