mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 17:46:05 -05:00
Merge pull request #825 from ZogStriP/do-not-show-clic-count-in-category-tag
do not show the clic count in category tag
This commit is contained in:
commit
3bfd3c9723
2 changed files with 12 additions and 6 deletions
|
@ -53,9 +53,12 @@ Discourse.ClickTrack = {
|
|||
if (!ownLink) {
|
||||
var $badge = $('span.badge', $link);
|
||||
if ($badge.length === 1) {
|
||||
// don't update counts in oneboxes (except when we force it)
|
||||
if ($link.closest(".onebox-result").length === 0 || $link.hasClass("track-link")) {
|
||||
$badge.html(parseInt($badge.html(), 10) + 1);
|
||||
// don't update counts in category badge
|
||||
if ($link.closest('.badge-category').length === 0) {
|
||||
// nor in oneboxes (except when we force it)
|
||||
if ($link.closest(".onebox-result").length === 0 || $link.hasClass("track-link")) {
|
||||
$badge.html(parseInt($badge.html(), 10) + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -171,9 +171,12 @@ Discourse.PostView = Discourse.View.extend({
|
|||
postView.$(".cooked a[href]").each(function() {
|
||||
var link = $(this);
|
||||
if (link.attr('href') === lc.url) {
|
||||
// don't display badge counts in oneboxes (except when we force it)
|
||||
if (link.closest(".onebox-result").length === 0 || link.hasClass("track-link")) {
|
||||
link.append("<span class='badge badge-notification clicks' title='" + Em.String.i18n("topic_summary.clicks") + "'>" + lc.clicks + "</span>");
|
||||
// don't display badge counts on category badge
|
||||
if (link.closest('.badge-category').length === 0) {
|
||||
// nor in oneboxes (except when we force it)
|
||||
if (link.closest(".onebox-result").length === 0 || link.hasClass("track-link")) {
|
||||
link.append("<span class='badge badge-notification clicks' title='" + Em.String.i18n("topic_summary.clicks") + "'>" + lc.clicks + "</span>");
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue