[ Index ]

PHP Cross Reference of moodle-2.8

title

Body

[close]

/grade/grading/form/rubric/js/ -> rubric.js (source)

   1  M.gradingform_rubric = {};
   2  
   3  /**
   4   * This function is called for each rubric on page.
   5   */
   6  M.gradingform_rubric.init = function(Y, options) {
   7      Y.on('click', M.gradingform_rubric.levelclick, '#rubric-'+options.name+' .level', null, Y, options.name);
   8      Y.all('#rubric-'+options.name+' .radio').setStyle('display', 'none')
   9      Y.all('#rubric-'+options.name+' .level').each(function (node) {
  10        if (node.one('input[type=radio]').get('checked')) {
  11          node.addClass('checked');
  12        }
  13      });
  14  };
  15  
  16  M.gradingform_rubric.levelclick = function(e, Y, name) {
  17      var el = e.target
  18      while (el && !el.hasClass('level')) el = el.get('parentNode')
  19      if (!el) return
  20      e.preventDefault();
  21      el.siblings().removeClass('checked');
  22      chb = el.one('input[type=radio]')
  23      if (!chb.get('checked')) {
  24          chb.set('checked', true)
  25          el.addClass('checked')
  26      } else {
  27          el.removeClass('checked');
  28          el.get('parentNode').all('input[type=radio]').set('checked', false)
  29      }
  30  }


Generated: Fri Nov 28 20:29:05 2014 Cross-referenced by PHPXref 0.7.1