Commit 5016dd82 authored by Clément Damiens's avatar Clément Damiens
Browse files

fix disconnected dda showing undefined votecount

parent 04ec7a0a
......@@ -2699,23 +2699,22 @@ var directory = {
str += '<hr>';
str += '<span class="col-xs-12 no-padding text-dark descMD">'+params.shortDescription+'</span>';
}
voteCount = "";
if(params.votes){
var vc = 0;
if(params.votes.up)
vc += Object.keys(params.votes.up).length;
if(params.votes.down)
vc += Object.keys(params.votes.down).length;
if(params.votes.uncomplet)
vc += Object.keys(params.votes.uncomplet).length;
if(params.votes.white)
vc += Object.keys(params.votes.white).length;
voteCount = " ("+vc+")";
}
//SHOW HIDE VOTE BTNs
if(typeof userId != "undefined" && userId != null && userId != ""){
var btnSize = (params.status == "amendementAndVote") ? "6" : "12";
voteCount = "";
if(params.votes){
var vc = 0;
if(params.votes.up)
vc += Object.keys(params.votes.up).length;
if(params.votes.down)
vc += Object.keys(params.votes.down).length;
if(params.votes.uncomplet)
vc += Object.keys(params.votes.uncomplet).length;
if(params.votes.white)
vc += Object.keys(params.votes.white).length;
voteCount = " ("+vc+")";
}
if( (params.status == "tovote" || params.status == "amendementAndVote") && params.hasVote ===false )
str += '<a href="javascript:;" '+ linkParams + ' data-coop-section="vote" class="bg-green openCoopPanelHtml btn col-sm-'+btnSize+' "><i class="fa fa-gavel"></i> '+trad.Vote+voteCount+'</a>';
//str += '<a href="javascript:" '+ linkParams + ' class="btn-openVoteDetail bg-green btn col-sm-'+btnSize+' "><i class="fa fa-gavel"></i> '+trad.Vote+'</a>';
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment