FIX: Don't increase link counts when they are in the thousands

This commit is contained in:
Robin Ward 2014-03-10 11:21:48 -04:00
parent d200e68bab
commit 6626a6c3ea
1 changed files with 4 additions and 1 deletions

View File

@ -56,7 +56,10 @@ Discourse.ClickTrack = {
if ($link.closest('.badge-category').length === 0) { if ($link.closest('.badge-category').length === 0) {
// nor in oneboxes (except when we force it) // nor in oneboxes (except when we force it)
if ($link.closest(".onebox-result").length === 0 || $link.hasClass("track-link")) { if ($link.closest(".onebox-result").length === 0 || $link.hasClass("track-link")) {
$badge.html(parseInt($badge.html(), 10) + 1); var html = $badge.html();
if (/^\d+$/.test(html)) {
$badge.html(parseInt(html, 10) + 1);
}
} }
} }
} }