Code Duplication    Length = 10-10 lines in 2 locations

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

@@ 1538-1547 (lines=10) @@
1535
*   @param: id - the item
1536
*   @type: public
1537
*/
1538
dhtmlXMenuObject.prototype.getItemPosition = function(id) {
1539
	id = this.idPrefix+id;
1540
	var pos = -1;
1541
	if (this.itemPull[id] == null) return pos;
1542
	var parent = this.itemPull[id]["parent"];
1543
	// var obj = (this.idPull["polygon_"+parent]!=null?this.idPull["polygon_"+parent].tbd:this.base);
1544
	var obj = (this.idPull["polygon_"+parent]!=null?this.idPull["polygon_"+parent].tbd:this.cont);
1545
	for (var q=0; q<obj.childNodes.length; q++) { if (obj.childNodes[q]==this.idPull["separator_"+id]||obj.childNodes[q]==this.idPull[id]) { pos = q; } }
1546
	return pos;
1547
}
1548
1549
/**
1550
*   @desc: sets new item's position in the current polygon (moves an item inside the single level)

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

@@ 1506-1515 (lines=10) @@
1503
*   @param: id - the item
1504
*   @type: public
1505
*/
1506
dhtmlXMenuObject.prototype.getItemPosition = function(id) {
1507
	id = this.idPrefix+id;
1508
	var pos = -1;
1509
	if (this.itemPull[id] == null) return pos;
1510
	var parent = this.itemPull[id]["parent"];
1511
	// var obj = (this.idPull["polygon_"+parent]!=null?this.idPull["polygon_"+parent].tbd:this.base);
1512
	var obj = (this.idPull["polygon_"+parent]!=null?this.idPull["polygon_"+parent].tbd:this.cont);
1513
	for (var q=0; q<obj.childNodes.length; q++) { if (obj.childNodes[q]==this.idPull["separator_"+id]||obj.childNodes[q]==this.idPull[id]) { pos = q; } }
1514
	return pos;
1515
}
1516
1517
/**
1518
*   @desc: sets new item's position in the current polygon (moves an item inside the single level)