Code Duplication    Length = 17-17 lines in 2 locations

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

@@ 939-955 (lines=17) @@
936
/****************************************************************************************************************************************************/
937
/*								 	"TOPLEVEL" LOW-LEVEL RENDERING						    */
938
/* redistrib selection in case of top node in real-time mode */
939
dhtmlXMenuObject.prototype._redistribTopLevelSelection = function(id, parent) {
940
	// kick polygons and decelect before selected menues
941
	var i = this._getSubItemToDeselectByPolygon("parent");
942
	this._removeSubItemFromSelected(-1, -1);
943
	for (var q=0; q<i.length; q++) {
944
		if (i[q] != id) { this._hidePolygon(i[q]); }
945
		if ((this.idPull[i[q]] != null) && (i[q] != id)) { this.idPull[i[q]].className = this.idPull[i[q]].className.replace(/Selected/g, "Normal"); }
946
	}
947
	// check if enabled
948
	if (this.itemPull[this.idPrefix+id]["state"] == "enabled") {
949
		this.idPull[this.idPrefix+id].className = "dhtmlxMenu_"+this.skin+"_TopLevel_Item_Selected";
950
		//
951
		this._addSubItemToSelected(this.idPrefix+id, "parent");
952
		this.menuSelected = (this.menuMode=="win"?(this.menuSelected!=-1?id:this.menuSelected):id);
953
		if ((this.itemPull[this.idPrefix+id]["complex"]) && (this.menuSelected != -1)) { this._showPolygon(this.idPrefix+id, this.dirTopLevel); }
954
	}
955
}
956
dhtmlXMenuObject.prototype._initTopLevelMenu = function() {
957
	// console.log(this.idPull);
958
	this.dirTopLevel = "bottom";

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

@@ 910-926 (lines=17) @@
907
/****************************************************************************************************************************************************/
908
/*								 	"TOPLEVEL" LOW-LEVEL RENDERING						    */
909
/* redistrib selection in case of top node in real-time mode */
910
dhtmlXMenuObject.prototype._redistribTopLevelSelection = function(id, parent) {
911
	// kick polygons and decelect before selected menues
912
	var i = this._getSubItemToDeselectByPolygon("parent");
913
	this._removeSubItemFromSelected(-1, -1);
914
	for (var q=0; q<i.length; q++) {
915
		if (i[q] != id) { this._hidePolygon(i[q]); }
916
		if ((this.idPull[i[q]] != null) && (i[q] != id)) { this.idPull[i[q]].className = this.idPull[i[q]].className.replace(/Selected/g, "Normal"); }
917
	}
918
	// check if enabled
919
	if (this.itemPull[this.idPrefix+id]["state"] == "enabled") {
920
		this.idPull[this.idPrefix+id].className = "dhtmlxMenu_"+this.skin+"_TopLevel_Item_Selected";
921
		//
922
		this._addSubItemToSelected(this.idPrefix+id, "parent");
923
		this.menuSelected = (this.menuMode=="win"?(this.menuSelected!=-1?id:this.menuSelected):id);
924
		if ((this.itemPull[this.idPrefix+id]["complex"]) && (this.menuSelected != -1)) { this._showPolygon(this.idPrefix+id, this.dirTopLevel); }
925
	}
926
}
927
dhtmlXMenuObject.prototype._initTopLevelMenu = function() {
928
	// console.log(this.idPull);
929
	this.dirTopLevel = "bottom";