mirror of
https://github.com/codeninjasllc/discourse.git
synced 2025-03-23 13:26:22 -04: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) {
|
if (!ownLink) {
|
||||||
var $badge = $('span.badge', $link);
|
var $badge = $('span.badge', $link);
|
||||||
if ($badge.length === 1) {
|
if ($badge.length === 1) {
|
||||||
// don't update counts in oneboxes (except when we force it)
|
// don't update counts in category badge
|
||||||
if ($link.closest(".onebox-result").length === 0 || $link.hasClass("track-link")) {
|
if ($link.closest('.badge-category').length === 0) {
|
||||||
$badge.html(parseInt($badge.html(), 10) + 1);
|
// 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() {
|
postView.$(".cooked a[href]").each(function() {
|
||||||
var link = $(this);
|
var link = $(this);
|
||||||
if (link.attr('href') === lc.url) {
|
if (link.attr('href') === lc.url) {
|
||||||
// don't display badge counts in oneboxes (except when we force it)
|
// don't display badge counts on category badge
|
||||||
if (link.closest(".onebox-result").length === 0 || link.hasClass("track-link")) {
|
if (link.closest('.badge-category').length === 0) {
|
||||||
link.append("<span class='badge badge-notification clicks' title='" + Em.String.i18n("topic_summary.clicks") + "'>" + lc.clicks + "</span>");
|
// 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