Code Duplication    Length = 2-11 lines in 2 locations

api/js/dhtmlxMenu/sources/dhtmlxmenu.js 1 location

@@ 265-275 (lines=11) @@
262
			this.idPull[pId].style.zIndex = this.zInd;
263
			
264
			//
265
			if (this.autoOverflow) {
266
				if (this.idPull[pId].firstChild.offsetHeight > this.menuY1+this.menuY2) {
267
					var t0 = Math.floor((this.menuY2-this.menuY1-35)/24);
268
					this.limit = t0;
269
				} else {
270
					this.limit = 0;
271
					
272
					if (this.idPull["arrowup_"+id] != null) this._removeUpArrow(String(id).replace(this.idPrefix,""));
273
					if (this.idPull["arrowdown_"+id] != null) this._removeDownArrow(String(id).replace(this.idPrefix,""));
274
				}
275
			}
276
			
277
			//#menu_overflow:06062008#{
278
			if (this.limit > 0 && this.limit < itemCount)  {

api/js/dhtmlxMenu/codebase/dhtmlxmenu.js 1 location

@@ 19-20 (lines=2) @@
16
[],c=0;c<this._selectedSubItems.length;c++)if(this._selectedSubItems[c][1]==a){b[b.length]=this._selectedSubItems[c][0];for(var b=b.concat(this._getSubItemToDeselectByPolygon(this._selectedSubItems[c][0])),d=!0,e=0;e<this._openedPolygons.length;e++)this._openedPolygons[e]==this._selectedSubItems[c][0]&&(d=!1);d==!0&&(this._openedPolygons[this._openedPolygons.length]=this._selectedSubItems[c][0]);this._selectedSubItems[c][0]=-1;this._selectedSubItems[c][1]=-1}return b};this._hidePolygon=function(a){if(this.idPull["polygon_"+
17
a]!=null){if(typeof this._menuEffect!="undefined"&&this._menuEffect!==!1)this._hidePolygonEffect("polygon_"+a);else{if(this.idPull["polygon_"+a].style.display=="none")return;this.idPull["polygon_"+a].style.display="none";if(this.idPull["arrowup_"+a]!=null)this.idPull["arrowup_"+a].style.display="none";if(this.idPull["arrowdown_"+a]!=null)this.idPull["arrowdown_"+a].style.display="none";this._updateItemComplexState(a,!0,!1);if(this._isIE6&&this.idPull["polygon_"+a+"_ie6cover"]!=null)this.idPull["polygon_"+
18
a+"_ie6cover"].style.display="none"}a=String(a).replace(this.idPrefix,"");a==this.topId&&(a=null);this.callEvent("onHide",[a]);a!=null&&this.skin=="dhx_terrace"&&this.itemPull[this.idPrefix+a].parent==this.idPrefix+this.topId&&this._improveTerraceButton(this.idPrefix+a,!0)}};this._showPolygon=function(a,b){var c=this._countVisiblePolygonItems(a);if(c!=0){var d="polygon_"+a;if(this.idPull[d]!=null&&this.idPull[a]!=null&&(!this.menuModeTopLevelTimeout||this.menuMode!="web"||this.context||this.idPull[a]._mouseOver||
19
b!=this.dirTopLevel)){this.fixedPosition||this._autoDetectVisibleArea();var e=0,f=0,g=null,i=null;this.idPull[d].style.visibility="hidden";this.idPull[d].style.left="0px";this.idPull[d].style.top="0px";this.idPull[d].style.display="";this.idPull[d].style.zIndex=this.zInd;if(this.autoOverflow)if(this.idPull[d].firstChild.offsetHeight>this.menuY1+this.menuY2){var m=Math.floor((this.menuY2-this.menuY1-35)/24);this.limit=m}else this.limit=0,this.idPull["arrowup_"+a]!=null&&this._removeUpArrow(String(a).replace(this.idPrefix,
20
"")),this.idPull["arrowdown_"+a]!=null&&this._removeDownArrow(String(a).replace(this.idPrefix,""));if(this.limit>0&&this.limit<c)this.idPull["arrowup_"+a]==null&&this._addUpArrow(String(a).replace(this.idPrefix,"")),this.idPull["arrowdown_"+a]==null&&this._addDownArrow(String(a).replace(this.idPrefix,"")),g=this.idPull["arrowup_"+a],g.style.visibility="hidden",g.style.display="",g.style.zIndex=this.zInd,e=g.offsetHeight,i=this.idPull["arrowdown_"+a],i.style.visibility="hidden",i.style.display="",
21
i.style.zIndex=this.zInd,f=i.offsetHeight;if(this.limit>0)this.limit<c?(this.idPull[d].style.height=24*this.limit+"px",this.idPull[d].scrollTop=0):this.idPull[d].style.height="";this.zInd+=this.zIndStep;if(this.itemPull[a]!=null)var C="polygon_"+this.itemPull[a].parent;else this.context&&(C=this.idPull[this.idPrefix+this.topId]);var q=this.idPull[a].tagName!=null?getAbsoluteLeft(this.idPull[a]):this.idPull[a][0],t=this.idPull[a].tagName!=null?getAbsoluteTop(this.idPull[a]):this.idPull[a][1],u=this.idPull[a].tagName!=
22
null?this.idPull[a].offsetWidth:0,B=this.idPull[a].tagName!=null?this.idPull[a].offsetHeight:0,l=0,n=0,s=this.idPull[d].offsetWidth,v=this.idPull[d].offsetHeight+e+f;b=="bottom"&&(l=this._rtl?q+(u!=null?u:0)-s:this._align=="right"?q+u-s:q-1+(b==this.dirTopLevel?this._topLevelRightMargin:0),n=t-1+B+this._topLevelBottomMargin);b=="right"&&(l=q+u-1,n=t+2);b=="left"&&(l=q-this.idPull[d].offsetWidth+2,n=t+2);b=="top"&&(l=q-1,n=t-v+2);if(this.fixedPosition)var w=65536,y=65536;else if(w=this.menuX2!=null?
23
this.menuX2:0,y=this.menuY2!=null?this.menuY2:0,w==0)window.innerWidth?(w=window.innerWidth,y=window.innerHeight):(w=document.body.offsetWidth,y=document.body.scrollHeight);l+s>w&&!this._rtl&&(l=q-s+2);l<this.menuX1&&this._rtl&&(l=q+u-2);l<0&&(l=0);n+v>y&&this.menuY2!=null&&(n=Math.max(t+B-v+2,this._isVisibleArea?this.menuY1+2:2),this.context&&this.idPrefix+this.topId==a&&i!=null&&(n-=2),this.itemPull[a]!=null&&!this.context&&this.itemPull[a].parent==this.idPrefix+this.topId&&(n-=this.base.offsetHeight));