mirror of
https://github.com/ForkAwesome/Fork-Awesome.git
synced 2024-12-28 14:31:31 +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>
|
</div>
|
||||||
<script>
|
<script>
|
||||||
try {
|
try {
|
||||||
var filterSet = JSON.parse('{{ icons | flattenIconFilters | jsonify }}');
|
window.filterSet = JSON.parse('{{ icons | flattenIconFilters | jsonify }}');
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error('Invalid JSON data!');
|
console.error('Invalid JSON data!');
|
||||||
var filterSet = [];
|
window.filterSet = [];
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<{% if page.navbar_active == "icons" %}div{% else %}section{% endif %} id="filter">
|
<{% if page.navbar_active == "icons" %}div{% else %}section{% endif %} id="filter">
|
||||||
|
@ -21,13 +21,19 @@ $(function() {
|
|||||||
arrowKeys: true
|
arrowKeys: true
|
||||||
});
|
});
|
||||||
|
|
||||||
$clear.click(function(e) {
|
$clear.on('click', function(e) {
|
||||||
e.preventDefault();
|
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 $this = $(this);
|
||||||
var val = $this.val().toLowerCase();
|
var val = $this.val().toLowerCase();
|
||||||
$filter.toggle(!!val);
|
$filter.toggle(!!val);
|
||||||
@ -57,7 +63,7 @@ $(function() {
|
|||||||
} else {
|
} else {
|
||||||
$no_results.hide();
|
$no_results.hide();
|
||||||
}
|
}
|
||||||
}).trigger('keyup');
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function inFilter(val, filter) {
|
function inFilter(val, filter) {
|
||||||
|
Loading…
Reference in New Issue
Block a user