better solution, replace /post/view/123#456 with #456 if #456 exists

This commit is contained in:
Shish
2012-02-22 15:13:05 +00:00
parent 11c804b347
commit ff30b54130
2 changed files with 5 additions and 2 deletions

View File

@ -56,7 +56,10 @@ $(document).ready(function() {
var target_id = $(elm).text().match(/#c?(\d+)/);
if(target_id && $("#c"+target_id[1])) {
var target_name = $("#c"+target_id[1]+" .username").html();
$(elm).html("@"+target_name);
if(target_name) {
$(elm).attr("href", "#c"+target_id[1]);
$(elm).html("@"+target_name);
}
}
});
});