summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDejan Noveski <dr.mote@gmail.com>2011-12-04 16:16:38 +0100
committerDejan Noveski <dr.mote@gmail.com>2011-12-04 16:16:38 +0100
commit801fe0298a415d9afe2cfb65049e533c0a0daf07 (patch)
treefa6b33b5d1725a570eaa9fd4072f658c1463ceee
parent50568a43725c632e744b81b4085781c01f80804c (diff)
downloadaskbot-801fe0298a415d9afe2cfb65049e533c0a0daf07.tar.gz
askbot-801fe0298a415d9afe2cfb65049e533c0a0daf07.tar.bz2
askbot-801fe0298a415d9afe2cfb65049e533c0a0daf07.zip
Don't show flag count if flag count is 0
-rw-r--r--askbot/skins/common/media/js/post.js10
1 files changed, 8 insertions, 2 deletions
diff --git a/askbot/skins/common/media/js/post.js b/askbot/skins/common/media/js/post.js
index 09c6c74d..59ba4fff 100644
--- a/askbot/skins/common/media/js/post.js
+++ b/askbot/skins/common/media/js/post.js
@@ -643,7 +643,10 @@ var Vote = function(){
//to django.po files
//_('anonymous users cannot flag offensive posts') + pleaseLogin;
if (data.success == "1"){
- $(object).children('span[class=darkred]').text("("+ data.count +")");
+ if(data.count > 0)
+ $(object).children('span[class=darkred]').text("("+ data.count +")");
+ else
+ $(object).children('span[class=darkred]').text("");
// Change the link text and rebind events
$(object).find("a.question-flag").html(gettext("remove flag"));
@@ -669,7 +672,10 @@ var Vote = function(){
//to django.po files
//_('anonymous users cannot flag offensive posts') + pleaseLogin;
if (data.success == "1"){
- $(object).children('span[class=darkred]').text("("+ data.count +")");
+ if(data.count > 0)
+ $(object).children('span[class=darkred]').text("("+ data.count +")");
+ else
+ $(object).children('span[class=darkred]').text("");
// Change the link text and rebind events
$(object).find("a.question-flag").html(gettext("flag offensive"));
var obj_id = $(object).attr("id");