[ Index ]

PHP Cross Reference of MyBB 1.8.37

title

Body

[close]

/admin/jscripts/ -> quick_perm_editor.js (source)

   1  var QuickPermEditor = {
   2  
   3      init: function(id)
   4      {
   5          if(!$('#fields_enabled_'+id) || !$('#fields_disabled_'+id))
   6          {
   7              return;
   8          }
   9          if(!$('#fields_'+id))
  10          {
  11              return;
  12          }
  13          
  14          $("#fields_enabled_"+id).sortable({
  15              connectWith: "#fields_disabled_"+id,
  16              dropOnEmpty: true,
  17              update: function(event, ui) {
  18                  QuickPermEditor.buildFieldsList(id);
  19              }
  20          }).disableSelection();
  21          
  22          $("#fields_disabled_"+id).sortable({
  23              connectWith: "#fields_enabled_"+id,
  24              dropOnEmpty: true,
  25              update: function(event, ui) {
  26                  QuickPermEditor.buildFieldsList(id);
  27              }
  28          }).disableSelection();
  29      },
  30  
  31      buildFieldsList: function(id)
  32      {
  33          new_input = '';
  34  
  35          $('#fields_enabled_'+id).children().each(function() {
  36              var textid = $(this).attr('id').split("-");
  37          
  38              if(textid[1])
  39              {
  40                  if(new_input)
  41                  {
  42                      new_input += ",";
  43                  }
  44                  new_input += textid[1];
  45              }
  46          });
  47          
  48          if($('#fields_'+id).val() != new_input)
  49          {
  50              if($('#default_permissions_'+id))
  51              {
  52                  $('#default_permissions_'+id).attr('checked', false);
  53              }
  54          }
  55          
  56          $('#fields_'+id).val(new_input);
  57  
  58          if($('#fields_inherit_'+id))
  59          {
  60              $('#fields_inherit_'+id).val(0);
  61          }
  62      },
  63  };


2005 - 2021 © MyBB.de | Alle Rechte vorbehalten! | Sponsor: netcup Cross-referenced by PHPXref