Add instant search to the market list
This commit is contained in:
13
static/js/market.js
Normal file
13
static/js/market.js
Normal file
@@ -0,0 +1,13 @@
|
||||
$(document).ready(function() {
|
||||
$('#market-search').keypress(function() {
|
||||
var needle = $(this).val().toLowerCase();
|
||||
$('#market-prices tr.market-item').each(function (idx, item) {
|
||||
var haystack = $(item).find('[class|="inventory-item"] .name').text().toLowerCase();
|
||||
if (haystack.search(needle) == -1) {
|
||||
item.style.display = "none";
|
||||
} else {
|
||||
item.style.display = null;
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user