You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I know, that the change was initially brought up by me but I just found out that some custom search plugins offer multilayer suggestions (e.g. add product to cart directly in the suggestion form (fibosearch). That said, the html for the suggestions is placed outside of the element with the ID #collapse-search.
code as is: // Close collapse if click outside searchform $(document).on('click', function (event) { if ($(event.target).closest('#collapse-search').length === 0) { $('#collapse-search').collapse('hide'); } });
I have to solutions for my issue in mind. Either we extend the solution to also check for a "key"-class like .search-area. Then I could add that class on pageload to the elements. Or if we move it to the custom.js file (or add a new "presets.js" file in the child template). I could just add the classes of the two areas without impacting the pageload.
So my preferred solution would be the presets.js
Sadly I couldn't find a simpler solution.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I know, that the change was initially brought up by me but I just found out that some custom search plugins offer multilayer suggestions (e.g. add product to cart directly in the suggestion form (fibosearch). That said, the html for the suggestions is placed outside of the element with the ID #collapse-search.
code as is:
// Close collapse if click outside searchform $(document).on('click', function (event) { if ($(event.target).closest('#collapse-search').length === 0) { $('#collapse-search').collapse('hide'); } });
I have to solutions for my issue in mind. Either we extend the solution to also check for a "key"-class like .search-area. Then I could add that class on pageload to the elements. Or if we move it to the custom.js file (or add a new "presets.js" file in the child template). I could just add the classes of the two areas without impacting the pageload.
So my preferred solution would be the presets.js
Sadly I couldn't find a simpler solution.
Beta Was this translation helpful? Give feedback.
All reactions