Advertisement
Guest User

Untitled

a guest
Nov 20th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. export function renderRating(elm, props) {
  2. const { uid, idfield, iddata, average, note, votesCount } = props;
  3.  
  4. const assessmentCatalog = document.querySelector('#row' + iddata + ' .card-rating');
  5.  
  6. render(<UIRatingStars
  7. key={iddata}
  8. firstToVote={_l('voting.firstToRate')}
  9. evaluateTheStartup={_l('voting.evaluateTheStartup')}
  10. myNoteIs={_l('voting.myNoteIs')}
  11. note={note}
  12. onVoted={(newValue) => {
  13. getNewAverage(newValue, idfield, iddata, uid)
  14. .then((json) => {
  15. json && renderRating(elm, { ...json, uid, idfield, iddata });
  16. });
  17. }}
  18. average={average}
  19. votesCount={votesCount}
  20. />, elm);
  21.  
  22. if(assessmentCatalog){
  23. render(<UIRatingStars
  24. key={iddata}
  25. firstToVote={_l('voting.firstToRate')}
  26. evaluateTheStartup={_l('voting.evaluateTheStartup')}
  27. myNoteIs={_l('voting.myNoteIs')}
  28. note={note}
  29. onVoted={(newValue) => {
  30. getNewAverage(newValue, idfield, iddata, uid)
  31. .then((json) => {
  32. json && renderRating(document.querySelector('#row' + iddata + ' .card-rating'), { ...json, uid, idfield, iddata });
  33. });
  34. }}
  35. average={average}
  36. votesCount={votesCount}
  37. />, document.querySelector('#row' + iddata + ' .card-rating'));
  38. }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement