##// END OF EJS Templates
quick-search-bar: show errors when search fails.
dan -
r3320:7faf2640 default
parent child Browse files
Show More
@@ -31,7 +31,8 b' def assert_and_get_main_filter_content(r'
31 assert data_item['url']
31 assert data_item['url']
32
32
33 if data_item['type'] == 'search':
33 if data_item['type'] == 'search':
34 assert data_item['value_display'].startswith('Full text search for:')
34 display_val = data_item['value_display']
35 assert 'Search for:' in display_val, display_val
35 elif data_item['type'] == 'repo':
36 elif data_item['type'] == 'repo':
36 repos.append(data_item)
37 repos.append(data_item)
37 elif data_item['type'] == 'repo_group':
38 elif data_item['type'] == 'repo_group':
@@ -594,7 +594,7 b' commit:efced4, to search for commits'
594
594
595 $('#main_filter').autocomplete({
595 $('#main_filter').autocomplete({
596 serviceUrl: pyroutes.url('goto_switcher_data'),
596 serviceUrl: pyroutes.url('goto_switcher_data'),
597 params: {"repo_group_id": templateContext.repo_group_id},
597 params: {"search_context": templateContext.search_context},
598 minChars:2,
598 minChars:2,
599 maxHeight:400,
599 maxHeight:400,
600 deferRequestBy: 300, //miliseconds
600 deferRequestBy: 300, //miliseconds
@@ -602,9 +602,15 b' commit:efced4, to search for commits'
602 autoSelectFirst: true,
602 autoSelectFirst: true,
603 formatResult: autocompleteMainFilterFormatResult,
603 formatResult: autocompleteMainFilterFormatResult,
604 lookupFilter: autocompleteMainFilterResult,
604 lookupFilter: autocompleteMainFilterResult,
605 onSelect: function(element, suggestion){
605 onSelect: function (element, suggestion) {
606 handleSelect(element, suggestion);
606 handleSelect(element, suggestion);
607 return false;
607 return false;
608 },
609 onSearchError: function (element, query, jqXHR, textStatus, errorThrown) {
610 if (jqXHR !== 'abort') {
611 alert("Error during search.\nError code: {0}".format(textStatus));
612 window.location = '';
613 }
608 }
614 }
609 });
615 });
610
616
General Comments 0
You need to be logged in to leave comments. Login now