Changeset - f8bbe83de0fe
[Not reviewed]
0 1 0
Ben Sturmfels (bsturmfels) - 11 months ago 2021-10-15 12:11:15
ben@sturm.com.au
Only focus search if search button clicked.
1 file changed with 6 insertions and 4 deletions:
0 comments (0 inline, 0 general)
www/conservancy/static/js/conservancy.js
Show inline comments
...
 
@@ -92,19 +92,21 @@ $(document).ready(function() {
 
        var wantShirt = $input.val() == "wantGiftYes";
 
        var $form = $input.parents('form').last();
 
        var $tShirtSelector = $('.t-shirt-size-selector', $form);
 
        $('input', $tShirtSelector).prop('disabled', wantShirt);
 
        $('input[name=no_shipping]', $form).val(wantShirt ? '2' : '0');
 
        if (wantShirt) {
 
            $tShirtSelector.slideDown(duration);
 
        } else {
 
            $tShirtSelector.slideUp(duration);
 
        }
 
    }).filter(':checked').trigger('change', 0);
 

	
 
    function toggleMenu(event) {
 
    // Open mobile/search menu.
 
    $('#menu-icon').on('click', function(event) {
 
        $('#navbar').toggleClass('mobile');
 
    });
 
    $('#search-icon').on('click', function(event) {
 
        $('#navbar').toggleClass('mobile');
 
        $('#search-query').focus();
 
    }
 
    $('#menu-icon').on('click', toggleMenu);
 
    $('#search-icon').on('click', toggleMenu);
 
    });
 
});
0 comments (0 inline, 0 general)