Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent self-closing offcanvas if dropdown has a nested dropdown (modified nav-walker with 3 or more levels depth) #350

Merged
merged 8 commits into from
Jan 9, 2023

Conversation

kreincke
Copy link
Contributor

@kreincke kreincke commented Jan 8, 2023

@crftwrk
Copy link
Member

crftwrk commented Jan 8, 2023

Thank you! But please do not change the nav-walker, because 3 or more levels depth is not supportet by Bootstrap and we follow straight the Bootstrap's way. Changing the nav-walker is something what you can do in your child.

The JS snippet just prevents offcanvas from self-closing if this has nested dropdowns (3 or more level depth).

Here is an improved snippet:

// Close offcanvas on click a, keep .dropdown-menu open
$('.offcanvas a:not(.dropdown-toggle, .remove_from_cart_button)').on('click', function () {
  $('.offcanvas').offcanvas('hide');
});

Ps. Changed both files directly in your branch

@crftwrk crftwrk marked this pull request as draft January 8, 2023 11:09
@crftwrk crftwrk self-requested a review January 8, 2023 14:56
@crftwrk crftwrk marked this pull request as ready for review January 8, 2023 14:59
@kreincke
Copy link
Contributor Author

kreincke commented Jan 8, 2023

Thanks, got it. And I will keep in mind your reasonable position

@crftwrk crftwrk changed the title Add and test the 3 level menu modifications desribed in Improve self-closing offcanvas to fit edited nav-walker with 3 or more levels depth Jan 9, 2023
@crftwrk crftwrk changed the title Improve self-closing offcanvas to fit edited nav-walker with 3 or more levels depth Prevent self-closing offcanvas if dropdown has a nested dropdown (modified nav-walker with 3 or more levels depth) Jan 9, 2023
@crftwrk crftwrk merged commit 68c2f6f into bootscore:main Jan 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants