mirror of
https://github.com/twisterarmy/twister-calm.git
synced 2025-01-12 07:58:05 +00:00
search valid usernames and hashtags
This commit is contained in:
parent
078a949e3d
commit
d75cf96f25
@ -367,12 +367,18 @@ function userSearchKeypress(item) {
|
||||
// Enter pressed
|
||||
var dummy = $('<a></a>');
|
||||
if (prefix == '#') { // hashtag
|
||||
dummy.attr('href', $.MAL.hashtagUrl(partialName));
|
||||
dummy.text('#' + partialName);
|
||||
openHashtagModal.call(dummy.get(0), item);
|
||||
partialName = _extractHashtag(partialName);
|
||||
if (partialName) {
|
||||
dummy.attr('href', $.MAL.hashtagUrl(partialName));
|
||||
dummy.text('#' + partialName);
|
||||
openHashtagModal.call(dummy.get(0), item);
|
||||
}
|
||||
} else { // username
|
||||
dummy.attr('href', $.MAL.userUrl(partialName));
|
||||
openProfileModal.call(dummy.get(0), item);
|
||||
partialName = _extractUsername(partialName);
|
||||
if (partialName) {
|
||||
dummy.attr('href', $.MAL.userUrl(partialName));
|
||||
openProfileModal.call(dummy.get(0), item);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user