create.js 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. $(function()
  2. {
  3. $('#point').change(function()
  4. {
  5. var type = $(this).val();
  6. var text = reviewText + $('#pickerDropMenu-pk_point').find("a[data-value=" + type + "]").find('.picker-option-text').text();
  7. $('#title').val(text);
  8. let productID = $('#product').val();
  9. var link = createLink('review', 'ajaxGetNodes', "project=" + projectID + '&object=' + type + '&product=' + productID);
  10. $('#reviewerBox').load(link, function(){$(this).find('select').chosen()});
  11. if(type == 'other')
  12. {
  13. $('#template').closest('tr').removeClass('hidden');
  14. $('#contenttemplate').closest('tr').removeClass('hidden');
  15. $('#doclib').closest('tr').removeClass('hide');
  16. $('#object').closest('td').removeClass('hidden');
  17. }
  18. else
  19. {
  20. $('#template').closest('tr').addClass('hidden');
  21. $('#contenttemplate').closest('tr').addClass('hidden');
  22. $('#doclib').closest('tr').addClass('hide');
  23. $('#object').closest('td').addClass('hidden');
  24. $('#object').closest('tbody').find('tr').removeClass('hide');
  25. }
  26. })
  27. if(typeof(reviewedPoints) != 'undefined')
  28. {
  29. $('#point option').each(function() {
  30. var $value = $(this).val();
  31. if($value == 'other' || $value == '') return;
  32. var stagePoints = reviewedPoints[$value];
  33. if(stagePoints.disabled === false) return;
  34. if($value in reviewedPoints) $(this).prop('disabled', true);
  35. });
  36. }
  37. $('#point').picker({
  38. maxDropHeight: 500
  39. });
  40. })