Advertisement
ulfben

dtree openTo (original)

Feb 6th, 2012
315
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //discussion: http://wordpress.org/support/topic/plugin-wp-dtree-open-to-selection?replies=11#post-2604841
  2. wpdTree.prototype.openTo = function(nId, bSelect, bFirst){
  3.     if(!bFirst){
  4.         for (var n=0; n<this.adtNodes.length; n++){
  5.             if(this.adtNodes[n].id == nId){
  6.                 nId=n;
  7.                 break;
  8.             }
  9.         }
  10.     }
  11.     var cn=this.adtNodes[nId];
  12.     if(cn.pid==this.root.id || !cn._p) return;
  13.     cn._io = true;
  14.     cn._is = bSelect;
  15.     if(this.completed && cn._hc) this.nodeStatus(true, cn._ai, cn._ls);
  16.     if(this.completed && bSelect) this.s(cn._ai);
  17.     else if(bSelect) this._sn=cn._ai;
  18.     this.openTo(cn._p._ai, false, true);
  19. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement