Changeset - 555163555332
[Not reviewed]
default
0 1 0
Branko Majic (branko) - 10 years ago 2013-10-23 11:05:57
branko@majic.rs
CONNT-23: Do not hide search suggestions when moving from search options to search field (keyboard navigation).
1 file changed with 3 insertions and 1 deletions:
0 comments (0 inline, 0 general)
conntrackt/static/conntrackt.js
Show inline comments
 
@@ -81,25 +81,27 @@
 
                            }
 
                        });
 

	
 
                        // Hide the suggestions if search options lose focus,
 
                        // and search field doesn't have the focus
 
                        // either. Timeout has to be used since focus change
 
                        // takes some time.
 
                        //
 
                        // @TODO: Figure out if this can be done without timeout, since it feels
 
                        // like race condition issue.
 
                        $(".search-option").blur(function(){
 
                            setTimeout(function() {
 
                                if ($(document.activeElement).attr('class') != "search") {
 
                                var focusedElement = $(document.activeElement);
 

	
 
                                if ( focusedElement.attr('id') != "search" && focusedElement.attr('class') != "search-option") {
 
                                    $("#search-suggestions").fadeOut(200);
 
                                }
 
                            }, 10);
 
                        });
 
                    } else {
 
                        // No search results were returned (nothing matched).
 
                        searchSuggestions.find("ul").empty().append("<li class='disabled'><a href='#'>No matches</a></li>");
 
                        searchSuggestions.fadeIn(200);
 
                    }
 

	
 
                })
 
                .fail(function() {
0 comments (0 inline, 0 general)