Code Duplication    Length = 3-28 lines in 2 locations

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

@@ 208-235 (lines=28) @@
205
	}
206
	/* end */
207
	/* define polygon's position for dinamic content rendering and shows it, added in version 0.3 */
208
	this._hidePolygon = function(id) {
209
		if (this.idPull["polygon_" + id] != null) {
210
			if (typeof(this._menuEffect) != "undefined" && this._menuEffect !== false) {
211
				this._hidePolygonEffect("polygon_"+id);
212
			} else {
213
				// already hidden
214
				if (this.idPull["polygon_"+id].style.display == "none") return;
215
				//
216
				this.idPull["polygon_"+id].style.display = "none";
217
				if (this.idPull["arrowup_"+id] != null) { this.idPull["arrowup_"+id].style.display = "none"; }
218
				if (this.idPull["arrowdown_"+id] != null) { this.idPull["arrowdown_"+id].style.display = "none"; }
219
				this._updateItemComplexState(id, true, false);
220
				// hide ie6 cover
221
				if (this._isIE6) { if (this.idPull["polygon_"+id+"_ie6cover"] != null) { this.idPull["polygon_"+id+"_ie6cover"].style.display = "none"; } }
222
			}
223
			// call event
224
			id = String(id).replace(this.idPrefix, "");
225
			if (id == this.topId) id = null;
226
			this.callEvent("onHide", [id]);
227
			
228
			// corners
229
			if (id != null && this.skin == "dhx_terrace" && this.itemPull[this.idPrefix+id].parent == this.idPrefix+this.topId) {
230
				this._improveTerraceButton(this.idPrefix+id, true);
231
			}
232
			
233
			
234
		}
235
	}
236
	this._showPolygon = function(id, openType) {
237
		
238
		var itemCount = this._countVisiblePolygonItems(id);

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

@@ 16-18 (lines=3) @@
13
2;this._topLevelOffsetLeft=this._topLevelRightMargin=1;this._arrowFFFix=_isIE?document.compatMode=="BackCompat"?0:-4:-4;break;case "dhx_web":this._arrowFFFix=0;break;case "dhx_terrace":this._topLevelOffsetLeft=this._topLevelRightMargin=this._topLevelBottomMargin=0,this._arrowFFFix=_isIE?document.compatMode=="BackCompat"?0:-4:-4}if(this.base._autoSkinUpdate)this.base.className=this.base.className.replace("dhtmlxMenu_"+b+"_Middle","")+" dhtmlxMenu_"+this.skin+"_Middle";for(var c in this.idPull)this.idPull[c].className=
14
String(this.idPull[c].className).replace(b,this.skin)};this.setSkin(this.skin);this.dLoad=!1;this.dLoadUrl="";this.dLoadSign="?";this.loaderIcon=!1;this.limit=0;this._scrollUpTM=null;this._scrollUpTMTime=20;this._scrollUpTMStep=3;this._scrollDownTM=null;this._scrollDownTMTime=20;this._scrollDownTMStep=3;this.context=!1;this.contextZones={};this.contextMenuZoneId=!1;this.contextHideAllMode=this.contextAutoHide=this.contextAutoShow=!0;this._selectedSubItems=[];this._openedPolygons=[];this._addSubItemToSelected=
15
function(a,b){for(var c=!0,d=0;d<this._selectedSubItems.length;d++)this._selectedSubItems[d][0]==a&&this._selectedSubItems[d][1]==b&&(c=!1);c==!0&&this._selectedSubItems.push([a,b]);return c};this._removeSubItemFromSelected=function(a,b){for(var c=[],d=!1,e=0;e<this._selectedSubItems.length;e++)this._selectedSubItems[e][0]==a&&this._selectedSubItems[e][1]==b?d=!0:c[c.length]=this._selectedSubItems[e];if(d==!0)this._selectedSubItems=c;return d};this._getSubItemToDeselectByPolygon=function(a){for(var b=
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!=