Code Duplication    Length = 1-17 lines in 2 locations

api/js/dhtmlxtree/sources/dhtmlxtree.js 1 location

@@ 2358-2374 (lines=17) @@
2355
*     @editing: pro
2356
*     @topic: 4  
2357
*/ 
2358
   dhtmlXTreeObject.prototype._openItem=function(item){ 
2359
   		   var state=this._getOpenState(item);
2360
		   if ((state<0)||(((this.XMLsource)&&(!item.XMLload)))){
2361
	           if    (!this.callEvent("onOpenStart",[item.id,state])) return 0;
2362
	           this._HideShow(item,2);
2363
				   if    (this.checkEvent("onOpenEnd")){ 
2364
						   if (this.onXLE==this._epnFHe) this._epnFHe(this,item.id,true);
2365
	                       if (!this.xmlstate || !this.XMLsource)
2366
	                       		this.callEvent("onOpenEnd",[item.id,this._getOpenState(item)]);
2367
	                        else{
2368
	                            this._oie_onXLE.push(this.onXLE);
2369
	                            this.onXLE=this._epnFHe;
2370
	                            }
2371
							}
2372
			   } else if (this._srnd) this._HideShow(item,2);
2373
           if (item.parentObject && !this._skip_open_parent) this._openItem(item.parentObject);
2374
   };
2375
   
2376
/**  
2377
*     @desc: collapse node

api/js/dhtmlxtree/codebase/dhtmlxtree.js 1 location

@@ 89-89 (lines=1) @@
86
dhtmlXTreeObject.prototype.setOnMouseOutHandler=function(a){this.ehlt=!0;this.attachEvent("onMouseOut",a)};dhtmlXTreeObject.prototype.enableTreeImages=function(a){this.timgen=convertStringToBoolean(a)};dhtmlXTreeObject.prototype.enableFixedMode=function(a){this.hfMode=convertStringToBoolean(a)};dhtmlXTreeObject.prototype.enableCheckBoxes=function(a,b){this.checkBoxOff=convertStringToBoolean(a);this.cBROf=!(this.checkBoxOff||convertStringToBoolean(b))};
87
dhtmlXTreeObject.prototype.setStdImages=function(a,b,c){this.imageArray[0]=a;this.imageArray[1]=b;this.imageArray[2]=c};dhtmlXTreeObject.prototype.enableTreeLines=function(a){this.treeLinesOn=convertStringToBoolean(a)};
88
dhtmlXTreeObject.prototype.setImageArrays=function(a,b,c,d,e,f){switch(a){case "plus":this.plusArray[0]=b;this.plusArray[1]=c;this.plusArray[2]=d;this.plusArray[3]=e;this.plusArray[4]=f;break;case "minus":this.minusArray[0]=b,this.minusArray[1]=c,this.minusArray[2]=d,this.minusArray[3]=e,this.minusArray[4]=f}};dhtmlXTreeObject.prototype.openItem=function(a){this.skipLock=!0;var b=this._globalIdStorageFind(a);return b?this._openItem(b):0};
89
dhtmlXTreeObject.prototype._openItem=function(a){var b=this._getOpenState(a);if(b<0||this.XMLsource&&!a.XMLload){if(!this.callEvent("onOpenStart",[a.id,b]))return 0;this._HideShow(a,2);if(this.checkEvent("onOpenEnd"))this.onXLE==this._epnFHe&&this._epnFHe(this,a.id,!0),!this.xmlstate||!this.XMLsource?this.callEvent("onOpenEnd",[a.id,this._getOpenState(a)]):(this._oie_onXLE.push(this.onXLE),this.onXLE=this._epnFHe)}else this._srnd&&this._HideShow(a,2);a.parentObject&&!this._skip_open_parent&&this._openItem(a.parentObject)};
90
dhtmlXTreeObject.prototype.closeItem=function(a){if(this.rootId==a)return 0;this.skipLock=!0;var b=this._globalIdStorageFind(a);if(!b)return 0;b.closeble&&this._HideShow(b,1);this.skipLock=!1};dhtmlXTreeObject.prototype.getLevel=function(a){var b=this._globalIdStorageFind(a);return!b?0:this._getNodeLevel(b,0)};dhtmlXTreeObject.prototype.setItemCloseable=function(a,b){var b=convertStringToBoolean(b),c=a&&a.span?a:this._globalIdStorageFind(a);if(!c)return 0;c.closeble=b};
91
dhtmlXTreeObject.prototype._getNodeLevel=function(a,b){return a.parentObject?this._getNodeLevel(a.parentObject,b+1):b};dhtmlXTreeObject.prototype.hasChildren=function(a){var b=this._globalIdStorageFind(a);return b?this.XMLsource&&!b.XMLload?!0:b.childsCount:0};dhtmlXTreeObject.prototype._getLeafCount=function(a){for(var b=0,c=0;c<a.childsCount;c++)a.childNodes[c].childsCount==0&&b++;return b};
92
dhtmlXTreeObject.prototype.setItemText=function(a,b,c){var d=this._globalIdStorageFind(a);if(!d)return 0;d.label=b;d.span.innerHTML=b;d.span.parentNode.parentNode.title=c||""};dhtmlXTreeObject.prototype.getItemTooltip=function(a){var b=this._globalIdStorageFind(a);return!b?"":b.span.parentNode.parentNode._dhx_title||b.span.parentNode.parentNode.title||""};dhtmlXTreeObject.prototype.refreshItem=function(a){if(!a)a=this.rootId;var b=this._globalIdStorageFind(a);this.deleteChildItems(a);this._loadDynXML(a)};