includes/clientside/static/comments.js
changeset 29 e5484a9e0818
parent 1 fe660c52c48f
child 74 68469a95658d
equal deleted inserted replaced
28:dd2edcdc6c03 29:e5484a9e0818
   307   }
   307   }
   308   if ( data.approved && data.approved != '1' )
   308   if ( data.approved && data.approved != '1' )
   309   {
   309   {
   310     document.getElementById('subject_' + data.id).innerHTML += ' <span style="color: #D84308">(Unapproved)</span>';
   310     document.getElementById('subject_' + data.id).innerHTML += ' <span style="color: #D84308">(Unapproved)</span>';
   311   }
   311   }
   312   if ( data.approved )
   312   if ( data.approved && ( typeof(data.approve_updated) == 'string' && data.approve_updated == 'yes' ) )
   313   {
   313   {
   314     var appr = ( data.approved == '1' ) ? 'Unapprove' : 'Approve';
   314     var appr = ( data.approved == '1' ) ? 'Unapprove' : 'Approve';
   315     document.getElementById('comment_approve_'+data.id).innerHTML = appr;
   315     document.getElementById('comment_approve_'+data.id).innerHTML = appr;
       
   316     
       
   317     // Update approval status
   316     var p = document.getElementById('comment_status');
   318     var p = document.getElementById('comment_status');
   317     var count = p.firstChild.nodeValue.split(' ')[2];
   319     var count = p.firstChild.nodeValue.split(' ')[2];
       
   320     
   318     if ( p.firstChild.nextSibling )
   321     if ( p.firstChild.nextSibling )
   319     {
   322     {
   320       var span = p.firstChild.nextSibling;
   323       var span = p.firstChild.nextSibling;
   321       var is = ( data.approved == '1' ) ? -1 : 1;
   324       var is = ( data.approved == '1' ) ? -1 : 1;
   322       var n_unapp = parseInt(span.firstChild.nodeValue.split(' ')[0]) + is;
   325       var n_unapp = parseInt(span.firstChild.nodeValue.split(' ')[0]) + is;