Advertisement
ulfben

dtree openTo (test)

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