Code Duplication    Length = 27-27 lines in 2 locations

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

@@ 847-873 (lines=27) @@
844
		this._isInited = true;
845
	}
846
}
847
dhtmlXMenuObject.prototype._countVisiblePolygonItems = function(id) {
848
	/*
849
	var count = 0;
850
	if ((this.idPull["polygon_"+id] != null) && (this.idPull[id] != null)) {
851
		for (var q=0; q<this.idPull["polygon_"+id].childNodes.length; q++) {
852
			var node = this.idPull["polygon_"+id].childNodes[q];
853
			count += (((node.style.display=="none")||(node.className=="dhtmlxMenu_SubLevelArea_Separator"))?0:1);
854
		}
855
	}
856
	*/
857
	/* updated in 0.4 */
858
	var count = 0;
859
	// console.log(this.idPull)
860
	for (var a in this.itemPull) {
861
		//console.log(a)
862
		var par = this.itemPull[a]["parent"];
863
		var tp = this.itemPull[a]["type"];
864
		if (this.idPull[a] != null) {
865
			// console.log(this.idPull[a])
866
			// alert(1111)
867
			if (par == id && (tp == "item" || tp == "radio" || tp == "checkbox") && this.idPull[a].style.display != "none") {
868
				count++;
869
			}
870
		}
871
	}
872
	return count;
873
}
874
dhtmlXMenuObject.prototype._redefineComplexState = function(id) {
875
	// alert(id)
876
	if (this.idPrefix+this.topId == id) { return; }

api/js/egw_action/test/js/dhtmlxmenu.js 1 location

@@ 818-844 (lines=27) @@
815
		this._isInited = true;
816
	}
817
}
818
dhtmlXMenuObject.prototype._countVisiblePolygonItems = function(id) {
819
	/*
820
	var count = 0;
821
	if ((this.idPull["polygon_"+id] != null) && (this.idPull[id] != null)) {
822
		for (var q=0; q<this.idPull["polygon_"+id].childNodes.length; q++) {
823
			var node = this.idPull["polygon_"+id].childNodes[q];
824
			count += (((node.style.display=="none")||(node.className=="dhtmlxMenu_SubLevelArea_Separator"))?0:1);
825
		}
826
	}
827
	*/
828
	/* updated in 0.4 */
829
	var count = 0;
830
	// console.log(this.idPull)
831
	for (var a in this.itemPull) {
832
		//console.log(a)
833
		var par = this.itemPull[a]["parent"];
834
		var tp = this.itemPull[a]["type"];
835
		if (this.idPull[a] != null) {
836
			// console.log(this.idPull[a])
837
			// alert(1111)
838
			if (par == id && (tp == "item" || tp == "radio" || tp == "checkbox") && this.idPull[a].style.display != "none") {
839
				count++;
840
			}
841
		}
842
	}
843
	return count;
844
}
845
dhtmlXMenuObject.prototype._redefineComplexState = function(id) {
846
	// alert(id)
847
	if (this.idPrefix+this.topId == id) { return; }