Code Duplication    Length = 1-5 lines in 3 locations

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

@@ 783-787 (lines=5) @@
780
	}
781
	this._xmlLoader = new dtmlXMLLoaderObject(this._xmlParser, window);
782
	/* show sublevel item */
783
	this._showSubLevelItem = function(id,back) {
784
		if (document.getElementById("arrow_" + this.idPrefix + id) != null) { document.getElementById("arrow_" + this.idPrefix + id).style.display = (back?"none":""); }
785
		if (document.getElementById("image_" + this.idPrefix + id) != null) { document.getElementById("image_" + this.idPrefix + id).style.display = (back?"none":""); }
786
		if (document.getElementById(this.idPrefix + id) != null) { document.getElementById(this.idPrefix + id).style.display = (back?"":"none"); }
787
	}
788
	/* hide sublevel item */
789
	this._hideSubLevelItem = function(id) {
790
		this._showSubLevelItem(id,true)

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

@@ 757-761 (lines=5) @@
754
	}
755
	this._xmlLoader = new dtmlXMLLoaderObject(this._xmlParser, window);
756
	/* show sublevel item */
757
	this._showSubLevelItem = function(id,back) {
758
		if (document.getElementById("arrow_" + this.idPrefix + id) != null) { document.getElementById("arrow_" + this.idPrefix + id).style.display = (back?"none":""); }
759
		if (document.getElementById("image_" + this.idPrefix + id) != null) { document.getElementById("image_" + this.idPrefix + id).style.display = (back?"none":""); }
760
		if (document.getElementById(this.idPrefix + id) != null) { document.getElementById(this.idPrefix + id).style.display = (back?"":"none"); }
761
	}
762
	/* hide sublevel item */
763
	this._hideSubLevelItem = function(id) {
764
		this._showSubLevelItem(id,true)

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

@@ 40-40 (lines=1) @@
37
null&&m.firstChild.nodeValue!=null?m.firstChild.nodeValue:"")}if(i==this.itemTextTagName)f.title=e.childNodes[g].firstChild.nodeValue;if(i==this.itemTipTagName)f.tip=e.childNodes[g].firstChild.nodeValue;if(i==this.itemHotKeyTagName)f.hotkey=e.childNodes[g].firstChild.nodeValue;if(i==this.itemHrefTagName&&f.type=="item")f.href_link=e.childNodes[g].firstChild.nodeValue,e.childNodes[g].getAttribute("target")!=null&&(f.href_target=e.childNodes[g].getAttribute("target"))}c++}return c};this._xmlParser=
38
function(){if(a.dLoad){var b=this.getXMLTopNode("menu");parentId=b.getAttribute("parentId")!=null?b.getAttribute("parentId"):null;if(parentId==null)a._buildMenu(b,null),a._initTopLevelMenu();else{a._buildMenu(b,a.idPrefix+parentId);a._addSubMenuPolygon(a.idPrefix+parentId,a.idPrefix+parentId);if(a.menuSelected==a.idPrefix+parentId){var c=a.idPrefix+parentId,d=a.itemPull[a.idPrefix+parentId].parent==a.idPrefix+a.topId,e=d&&!a.context?a.dirTopLevel:a.dirSubLevel,f=!1;if(d&&a.menuModeTopLevelTimeout&&
39
a.menuMode=="web"&&!a.context){var g=a.idPull[a.idPrefix+parentId];if(g._mouseOver==!0){var p=a.menuModeTopLevelTimeoutTime-((new Date).getTime()-g._dynLoadTM);if(p>1)g._menuOpenTM=window.setTimeout(function(){a._showPolygon(c,e)},p),f=!0}}f||a._showPolygon(c,e)}a.itemPull[a.idPrefix+parentId].loaded="yes";a.loaderIcon==!0&&a._updateLoaderIcon(a.idPrefix+parentId,!1)}this.destructor();a.callEvent("onXLE",[])}else b=this.getXMLTopNode("menu"),a._buildMenu(b,null),a.init(),a.callEvent("onXLE",[]),a._doOnLoad()};
40
this._xmlLoader=new dtmlXMLLoaderObject(this._xmlParser,window);this._showSubLevelItem=function(a,b){if(document.getElementById("arrow_"+this.idPrefix+a)!=null)document.getElementById("arrow_"+this.idPrefix+a).style.display=b?"none":"";if(document.getElementById("image_"+this.idPrefix+a)!=null)document.getElementById("image_"+this.idPrefix+a).style.display=b?"none":"";if(document.getElementById(this.idPrefix+a)!=null)document.getElementById(this.idPrefix+a).style.display=b?"":"none"};this._hideSubLevelItem=
41
function(a){this._showSubLevelItem(a,!0)};this.idPrefix=this._genStr(12);this._bodyClick=function(b){b=b||event;b.button==2||_isOpera&&b.ctrlKey==!0||(a.context?a.contextAutoHide&&(!_isOpera||a._isContextMenuVisible()&&_isOpera)&&a._hideContextMenu():a._clearAndHide&&a._clearAndHide())};this._bodyContext=function(b){var b=b||event,c=String((b.srcElement||b.target).className);if(!(c.search("dhtmlxMenu")!=-1&&c.search("SubLevelArea")!=-1)){for(var d=!0,e=b.target||b.srcElement;e!=null;)e.id!=null&&
42
a.isContextZone(e.id)&&(d=!1),e==document.body&&(d=!1),e=e.parentNode;d&&a.hideContextMenu()}};typeof window.addEventListener!="undefined"?(window.addEventListener("click",this._bodyClick,!1),window.addEventListener("contextmenu",this._bodyContext,!1)):(document.body.attachEvent("onclick",this._bodyClick),document.body.attachEvent("oncontextmenu",this._bodyContext));this._UID=this._genStr(32);dhtmlxMenuObjectLiveInstances[this._UID]=this;dhtmlxEventable(this);return this}
43
dhtmlXMenuObject.prototype.init=function(){if(this._isInited!=!0)this.dLoad?(this.callEvent("onXLS",[]),this._xmlLoader.loadXML(this.dLoadUrl+this.dLoadSign+"action=loadMenu&etc="+(new Date).getTime())):(this._initTopLevelMenu(),this._isInited=!0)};