...
|
...
|
@@ -639,9 +639,14 @@ $searchKey.keyup(function(e) { |
|
|
searchSuggest(val);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if ($searchKey.val() === '') {
|
|
|
$searchKey.mouseenter();
|
|
|
// 查询历史记录
|
|
|
searchSuggestHistory(); //eslint-disable-line
|
|
|
} else {
|
|
|
$searchHistory.hide();
|
|
|
}
|
|
|
|
|
|
}).focus(function() {
|
|
|
var val = $.trim($(this).val());
|
|
|
|
...
|
...
|
@@ -652,7 +657,12 @@ $searchKey.keyup(function(e) { |
|
|
$(this).css('color', '#333');
|
|
|
|
|
|
setTimeout(function() {
|
|
|
$searchKey.mouseenter();
|
|
|
|
|
|
if ($searchKey.val() === '') {
|
|
|
// 查询历史记录
|
|
|
searchSuggestHistory(); //eslint-disable-line
|
|
|
}
|
|
|
|
|
|
}, 10000);
|
|
|
|
|
|
}).blur(function() {
|
...
|
...
|
@@ -661,8 +671,10 @@ $searchKey.keyup(function(e) { |
|
|
if (val === '') {
|
|
|
$(this).val(defaultSearch).css('color', '#999');
|
|
|
}
|
|
|
|
|
|
setTimeout(function() {
|
|
|
$searchSug.hide();
|
|
|
$searchHistory.hide();
|
|
|
}, 200);
|
|
|
});
|
|
|
|
...
|
...
|
@@ -892,6 +904,8 @@ function searchSuggestHistory() { |
|
|
|
|
|
if ($searchHistory.find('li').length === 0) {
|
|
|
$searchHistory.hide();
|
|
|
} else {
|
|
|
$searchHistory.show();
|
|
|
}
|
|
|
|
|
|
// 历史记录清空
|
...
|
...
|
@@ -917,20 +931,9 @@ $searchKey.focus(function() { |
|
|
|
|
|
if (val === '') {
|
|
|
searchSuggestHistory();
|
|
|
}
|
|
|
}).mouseleave(function() {
|
|
|
$searchHistory.hide();
|
|
|
});
|
|
|
|
|
|
$('.search-suggest-history').mouseenter(function() {
|
|
|
|
|
|
if ($searchHistory.find('li').length === 0) {
|
|
|
$searchHistory.hide();
|
|
|
} else {
|
|
|
$searchHistory.show();
|
|
|
$searchHistory.hide();
|
|
|
}
|
|
|
}).mouseleave(function() {
|
|
|
$searchHistory.hide();
|
|
|
});
|
|
|
|
|
|
/**
|
...
|
...
|
|