- This topic has 46 replies, 3 voices, and was last updated 5 years, 1 month ago by Tom.
-
AuthorPosts
-
March 5, 2019 at 6:45 am #829388DavidStaffCustomer Support
Keep us posted π
March 5, 2019 at 7:01 am #829538NeilI was intrigued (and it’s a bit more interesting than the other work I’m doing) so went ahead and made the changes. Why am I only just finding out about the GP Elements functionality now? – Could have saved me a lot of time and hassle with some other things π
I quite like the fact that the search bar is always visible now but let’s see how easy it is to show/hide it on a click of the search icon…
My concern now is that the search bar has its own internal cross to clear the search. This is going to look messy when the other cross is also showing.
March 5, 2019 at 7:59 am #829591DavidStaffCustomer SupportHaha – we do need to start some better promotion π Its been around for a while now….
So i can see the UI could be somewhat confusing. Might take a little working.
If you can also add the button to the hook ie.
<span class="custom-search-item" title="Search"><a href="#"><span class="screen-reader-text">Search</span></a></span>
Then at least we have the elements in place. Can then look at making it so when the Search icon is clicked the Search widget appears below the nav. And the Search Icon changes to “Close” or something…
March 5, 2019 at 8:07 am #829595NeilI’ve made that update now.
March 5, 2019 at 8:46 am #829641DavidStaffCustomer SupportSo for now you can remove the jQuery as this will change and all of the CSS from here:
https://generatepress.com/forums/topic/woocommerce-product-search-widget/page/2/#post-828779
Apart from this:
.custom-search-item a:before { content: "\f002"; font-family: GeneratePress; width: 1.28571429em; text-align: center; display: inline-block; margin-left: 10px; } .custom-search-item.close-search a:before { content: "\f00d"; }
March 5, 2019 at 9:16 am #829691NeilOk, made those changes.
March 5, 2019 at 9:44 am #829718DavidStaffCustomer SupportLets try this CSS:
@media (max-width: 768px) { #mobile-header>.inside-navigation { align-items: center; } .dgwt-wcas-search-wrapp { order: 5; } .custom-search-item { order: 3; padding-left: 20px; padding-right: 20px; } .dgwt-wcas-search-wrapp { max-height: 0; visibility: hidden; pointer-events: none; } .dgwt-wcas-search-wrapp.visible { max-height: 100%; visibility: visible; pointer-events: auto; } }
and this JS:
jQuery('.custom-search-item').on('click', function(e) { jQuery(this).toggleClass("close-search"); jQuery('.dgwt-wcas-search-wrapp').toggleClass("visible"); e.preventDefault(); });
March 5, 2019 at 10:01 am #829743NeilHmmm, not quite.
The search box has vanished on the desktop again and clicking the search icon on mobile doesn’t make the search box appear.
March 5, 2019 at 10:06 am #829747DavidStaffCustomer SupportUrgh (lol) – edited the CSS above so it only applies to mobile.
Did you swap over the jQuery?
March 5, 2019 at 10:17 am #829757Neilπ
Swapped the jQuery. It’s running as the search icon changes to the cross. No search box appears though.
March 5, 2019 at 10:30 am #829765DavidStaffCustomer SupportTry clearing your cache. Works for me π
March 5, 2019 at 10:51 am #829774DavidStaffCustomer SupportAdded a bit more CSS here to remove the search widget visibility and pointer events when hidden just to be safe.
March 5, 2019 at 10:57 am #829778NeilAnd we’re finally there I think π
I just need to sort the colour out (not sure why it’s gone orange) but I think that’s within my limited capabilities.
Thanks so much for your support and perseverance with me. I honestly owe you a beer/coffee!
I’ll test it fully over the next few days and let you know how I get on.
March 5, 2019 at 11:28 am #829809DavidStaffCustomer SupportAwesome π Glad to hear that.
Tom appreciates any donations to support developments π
https://generatepress.com/ongoing-development/
Or feel free to leave a review. All welcome.
March 5, 2019 at 11:31 am #829822NeilDonation made, grab yourself a coffee on me π
-
AuthorPosts
- You must be logged in to reply to this topic.