...
|
...
|
@@ -670,9 +670,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());
|
|
|
|
...
|
...
|
@@ -683,7 +688,12 @@ $searchKey.keyup(function(e) { |
|
|
$(this).css('color', '#333');
|
|
|
|
|
|
setTimeout(function() {
|
|
|
$searchKey.mouseenter();
|
|
|
|
|
|
if ($searchKey.val() === '') {
|
|
|
// 查询历史记录
|
|
|
searchSuggestHistory(); //eslint-disable-line
|
|
|
}
|
|
|
|
|
|
}, 10000);
|
|
|
|
|
|
}).blur(function() {
|
...
|
...
|
@@ -692,8 +702,10 @@ $searchKey.keyup(function(e) { |
|
|
if (val === '') {
|
|
|
$(this).val(defaultSearch).css('color', '#999');
|
|
|
}
|
|
|
|
|
|
setTimeout(function() {
|
|
|
$searchSug.hide();
|
|
|
$searchHistory.hide();
|
|
|
}, 200);
|
|
|
});
|
|
|
|
...
|
...
|
@@ -925,6 +937,8 @@ function searchSuggestHistory() { |
|
|
|
|
|
if ($searchHistory.find('li').length === 0) {
|
|
|
$searchHistory.hide();
|
|
|
} else {
|
|
|
$searchHistory.show();
|
|
|
}
|
|
|
|
|
|
// 历史记录清空
|
...
|
...
|
@@ -950,20 +964,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();
|
|
|
});
|
|
|
|
|
|
/**
|
...
|
...
|
|