rem: var selections = GetTreeSelections(permissionsTree);  for (var s = selections.length - 1; s >= 0; s--) { var i = selections[s];  var host = permissions[i].host; updatePendingRemovals(host);  permissions[i] = null; }  for (var j = 0; j < permissions.length; j++) { if (permissions[j] == null) { var k = j; while ((k < permissions.length) && (permissions[k] == null)) { k++; } permissions.splice(j, k-j); permissionsTreeView.rowCount -= k - j; permissionsTree.treeBoxObject.rowCountChanged(j, j - k); } }  if (permissions.length) { var nextSelection = (selections[0] < permissions.length) ? selections[0] : permissions.length - 1; permissionsTreeView.selection.select(nextSelection); permissionsTree.treeBoxObject.ensureRowIsVisible(nextSelection); } else { document.getElementById("removePermission").setAttribute("disabled", "true") document.getElementById("removeAllPermissions").setAttribute("disabled","true"); } 
add: DeleteSelectedItemFromTree(permissionsTree, permissionsTreeView, additions, removals, "removePermission", "removeAllPermissions"); 
context: function deletePermissions() {  var selections = GetTreeSelections(permissionsTree);    for (var s = selections.length - 1; s >= 0; s--) {    var i = selections[s];    var host = permissions[i].host;    updatePendingRemovals(host);    permissions[i] = null;  }  for (var j = 0; j < permissions.length; j++) {    if (permissions[j] == null) {      var k = j;      while ((k < permissions.length) && (permissions[k] == null)) {        k++;      }      permissions.splice(j, k-j);      permissionsTreeView.rowCount -= k - j;      permissionsTree.treeBoxObject.rowCountChanged(j, j - k);    }  }  if (permissions.length) {    var nextSelection = (selections[0] < permissions.length) ? selections[0] : permissions.length - 1;    permissionsTreeView.selection.select(nextSelection);    permissionsTree.treeBoxObject.ensureRowIsVisible(nextSelection);  }   else {    document.getElementById("removePermission").setAttribute("disabled", "true")    document.getElementById("removeAllPermissions").setAttribute("disabled","true");  }}
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10234/c50bdfb4ec30c1c58f4046bc2bfb7ae17626fe3f/permissionsManager.js/buggy/suite/common/permissions/permissionsManager.js