[ Index ]

PHP Cross Reference of moodle-2.8

title

Body

[close]

/user/ -> module.js (source)

   1  
   2  M.core_user = {};
   3  
   4  M.core_user.init_participation = function(Y) {
   5      Y.on('change', function() {
   6          var action = Y.one('#formactionid');
   7          if (action.get('value') == '') {
   8              return;
   9          }
  10          var ok = false;
  11          Y.all('input.usercheckbox').each(function() {
  12              if (this.get('checked')) {
  13                  ok = true;
  14              }
  15          });
  16          if (!ok) {
  17              // no checkbox selected
  18              return;
  19          }
  20          Y.one('#participantsform').submit();
  21      }, '#formactionid');
  22  
  23      Y.on('click', function(e) {
  24          Y.all('input.usercheckbox').each(function() {
  25              this.set('checked', 'checked');
  26          });
  27      }, '#checkall');
  28  
  29      Y.on('click', function(e) {
  30          Y.all('input.usercheckbox').each(function() {
  31              this.set('checked', '');
  32          });
  33      }, '#checknone');
  34  };
  35  
  36  M.core_user.init_tree = function(Y, expand_all, htmlid) {
  37      Y.use('yui2-treeview', function(Y) {
  38          var tree = new Y.YUI2.widget.TreeView(htmlid);
  39  
  40          tree.subscribe("clickEvent", function(node, event) {
  41              // we want normal clicking which redirects to url
  42              return false;
  43          });
  44  
  45          if (expand_all) {
  46              tree.expandAll();
  47          }
  48  
  49          tree.render();
  50      });
  51  };


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