Tagged: x
-
AuthorPosts
-
October 13, 2016 at 9:19 am #1214726
2342JParticipantHmm.
October 13, 2016 at 12:22 pm #1215023
RupokMemberIf you still face any issue feel free to let us know. We’ll be happy to assist you.
December 2, 2016 at 12:03 pm #1279004
2342JParticipantThis worked for me. Thank you. Now I notice that when you click on the search it opens and works, but you can’t cancel/close it by clicking on the screen again.
December 2, 2016 at 2:07 pm #1279130
2342JParticipantCan you take a look at this java script again? It does not cancel the search on keydown.
jQuery(function($) { var $trigger = $('.x-btn-navbar-search'); var $formWrap = $('.x-searchform-overlay'); var $input = $formWrap.find('.search-query'); var escKey = 27; function clearSearch() { $formWrap.toggleClass('in'); setTimeout(function() { $input.val(''); }, 350); } $trigger.on('touchstart click', function(e) { e.preventDefault(); $formWrap.toggleClass('in'); $input.focus(); }); $formWrap.on('touchstart click', function(e) { if ( ! $(e.target).hasClass('search-query') ) { clearSearch(); } }); $(document).keydown(function(e) { if ( e.which === escKey ) { if ( $formWrap.hasClass('in') ) { clearSearch(); } } }); });December 2, 2016 at 6:03 pm #1279319
Rue NelModeratorHello There,
We have tried to login to your site to fix the issue. Regretfully the given access is no longer working for us. Regrading the JS code, the esc key works perfectly when we tested your site. It’s just that the search overlay doesn’t exit when you click anywhere outside the search input. Could you please give us access to your site again so that we can fix the issue. If you have installed WordFence, please temporarily disable it for the time being.
Thank you.
December 3, 2016 at 9:12 pm #1280214
2342JParticipantThis reply has been marked as private.December 4, 2016 at 2:27 am #1280323
Rue NelModeratorHello There,
To resolve your issue, please update the JS code and use this instead:
jQuery(function($) { var $trigger = $('.x-btn-navbar-search'); var $formWrap = $('.x-searchform-overlay'); var $input = $formWrap.find('.search-query'); var escKey = 27; function clearSearch() { $formWrap.toggleClass('in'); setTimeout(function() { $input.val(''); }, 350); } $trigger.on('touchstart click', function(e) { e.preventDefault(); $formWrap.toggleClass('in'); $input.focus(); }); $(document).keydown(function(e) { if ( e.which === escKey ) { if ( $formWrap.hasClass('in') ) { clearSearch(); } } }); });We would loved to know if this has work for you. Thank you.
December 4, 2016 at 9:36 am #1280519
2342JParticipantYes! Well done. Thanks for that, I’m learning a lot from you.
December 4, 2016 at 9:53 am #1280532
ThaiModeratorIf you need anything else please let us know.
December 18, 2016 at 12:51 pm #1297308
2342JParticipantResolved. Thanks again!
December 18, 2016 at 5:53 pm #1297453
Rue NelModeratorYou’re welcome! We’re happy to help you out.
If you need anything else we can help you with, don’t hesitate to open another thread. -
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1203411 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
