[ Index ]

PHP Cross Reference of Unnamed Project

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          // Presence of a show all link indicates we should redirect to
  25          // a page with all users listed and checked, otherwise just check
  26          // those already shown.
  27          var showallink = this.getAttribute('data-showallink');
  28          if (showallink) {
  29              window.location = showallink;
  30          }
  31          Y.all('input.usercheckbox').each(function() {
  32              this.set('checked', 'checked');
  33          });
  34      }, '#checkall, #checkallonpage');
  35  
  36      Y.on('click', function(e) {
  37          Y.all('input.usercheckbox').each(function() {
  38              this.set('checked', '');
  39          });
  40      }, '#checknone');
  41  };
  42  
  43  M.core_user.init_tree = function(Y, expand_all, htmlid) {
  44      Y.use('yui2-treeview', function(Y) {
  45          var tree = new Y.YUI2.widget.TreeView(htmlid);
  46  
  47          tree.subscribe("clickEvent", function(node, event) {
  48              // we want normal clicking which redirects to url
  49              return false;
  50          });
  51  
  52          if (expand_all) {
  53              tree.expandAll();
  54          }
  55  
  56          tree.render();
  57      });
  58  };


Generated: Thu Aug 11 10:00:09 2016 Cross-referenced by PHPXref 0.7.1