player tracher search - ignore leading @ character, to give reasonable behaviour when used like the old search system

This commit is contained in:
Jon Atkins 2015-02-27 00:26:50 +00:00
parent 2b932d4c69
commit 1afc04b45c

View File

@ -550,6 +550,8 @@ window.plugin.playerTracker.onSearchResultSelected = function(result, event) {
window.plugin.playerTracker.onSearch = function(query) { window.plugin.playerTracker.onSearch = function(query) {
var term = query.term.toLowerCase(); var term = query.term.toLowerCase();
if (term.length && term[0] == '@') term = term.substr(1);
$.each(plugin.playerTracker.stored, function(nick, data) { $.each(plugin.playerTracker.stored, function(nick, data) {
if(nick.toLowerCase().indexOf(term) === -1) return; if(nick.toLowerCase().indexOf(term) === -1) return;