mirror of
https://github.com/FortAwesome/Font-Awesome.git
synced 2024-12-27 14:01:30 +08:00
Merge pull request #5178 from williamboman/fix-tabcomplete-hint
Fix search input hint not clearing properly.
This commit is contained in:
commit
8bc1bd1c5d
@ -5,10 +5,10 @@
|
||||
</div>
|
||||
<script>
|
||||
try {
|
||||
var filterSet = JSON.parse('{{ icons | flattenIconFilters | jsonify }}');
|
||||
window.filterSet = JSON.parse('{{ icons | flattenIconFilters | jsonify }}');
|
||||
} catch (e) {
|
||||
console.error('Invalid JSON data!');
|
||||
var filterSet = [];
|
||||
window.filterSet = [];
|
||||
}
|
||||
</script>
|
||||
<{% if page.navbar_active == "icons" %}div{% else %}section{% endif %} id="filter">
|
||||
|
@ -21,13 +21,19 @@ $(function() {
|
||||
arrowKeys: true
|
||||
});
|
||||
|
||||
$clear.click(function(e) {
|
||||
$clear.on('click', function(e) {
|
||||
e.preventDefault();
|
||||
$filter_by.val('').trigger('keyup').focus();
|
||||
$filter_by
|
||||
.val('')
|
||||
.trigger('input')
|
||||
.trigger('keyup')
|
||||
.focus();
|
||||
|
||||
$clear.addClass('gone'); // Hide clear button
|
||||
});
|
||||
|
||||
|
||||
$filter_by.keyup(function() {
|
||||
$filter_by.on('keyup', function() {
|
||||
var $this = $(this);
|
||||
var val = $this.val().toLowerCase();
|
||||
$filter.toggle(!!val);
|
||||
@ -57,7 +63,7 @@ $(function() {
|
||||
} else {
|
||||
$no_results.hide();
|
||||
}
|
||||
}).trigger('keyup');
|
||||
});
|
||||
}
|
||||
|
||||
function inFilter(val, filter) {
|
||||
|
Loading…
Reference in New Issue
Block a user