Browse Source

search valid usernames and hashtags

master
Denis Ryabov 11 years ago
parent
commit
d75cf96f25
  1. 6
      js/twister_following.js

6
js/twister_following.js

@ -367,13 +367,19 @@ function userSearchKeypress(item) { @@ -367,13 +367,19 @@ function userSearchKeypress(item) {
// Enter pressed
var dummy = $('<a></a>');
if (prefix == '#') { // hashtag
partialName = _extractHashtag(partialName);
if (partialName) {
dummy.attr('href', $.MAL.hashtagUrl(partialName));
dummy.text('#' + partialName);
openHashtagModal.call(dummy.get(0), item);
}
} else { // username
partialName = _extractUsername(partialName);
if (partialName) {
dummy.attr('href', $.MAL.userUrl(partialName));
openProfileModal.call(dummy.get(0), item);
}
}
return false;
}

Loading…
Cancel
Save