actividades.js 1.5 KB

123456789101112131415161718192021222324252627282930313233
  1. /**
  2. * Expands or contracts a past activity.
  3. * @param id Activity ID.
  4. */
  5. function showPastActivity(id){
  6. if (document.getElementById("past_activity_details_" + id).clientHeight > 0){
  7. document.getElementById("past_activity_details_" + id).style.maxHeight = '0em';
  8. setTimeout(function(){document.getElementById('slid_past_activity_' + id).src = '/img/misc/slid-right.png';}, 500);
  9. }
  10. else{
  11. document.getElementById('past_activity_details_' + id).style.maxHeight = '40em';
  12. setTimeout(function(){document.getElementById('slid_past_activity_' + id).src = '/img/misc/slid-down.png';}, 500);
  13. }
  14. document.getElementById('slid_past_activity_' + id).style.opacity = '0';
  15. setTimeout(function(){document.getElementById('slid_past_activity_' + id).style.opacity = '1';}, 500);
  16. }
  17. /**
  18. * Toggles a drop-down list.
  19. * @param name. Element name, same as the id without the 'list_'.
  20. */
  21. function toggleElement(name){
  22. if (document.getElementById("list_" + name).clientHeight > 0){
  23. document.getElementById("list_" + name).style.maxHeight = '0em';
  24. setTimeout(function(){document.getElementById('slid_' + name).src = '/img/misc/slid-right.png';}, 500);
  25. }
  26. else{
  27. document.getElementById("list_" + name).style.maxHeight = '90em';
  28. setTimeout(function(){document.getElementById('slid_' + name).src = '/img/misc/slid-down.png';}, 500);
  29. }
  30. document.getElementById('slid_' + name).style.opacity = '0';
  31. setTimeout(function(){document.getElementById('slid_' + name).style.opacity = '1';}, 500);
  32. }