/* Product Name: dhtmlxSuite Version: 5.2.0 Edition: Professional License: content of this file is covered by DHTMLX Commercial or Enterprise license. Usage without proper license is prohibited. To obtain it contact sales@dhtmlx.com Copyright UAB Dinamenta http://www.dhtmlx.com */ function dhtmlXMenuObject(base, skin) { var that = this; // iframe this.conf = { skin: (skin||window.dhx4.skin||(typeof(dhtmlx)!="undefined"?dhtmlx.skin:null)||window.dhx4.skinDetect("dhxmenu")||"material"), mode: "web", align: "left", is_touched: false, selected: -1, last_click: -1, fixed_pos: false, // should be used for frameset in IE rtl: false, icons_path: "", icons_css: false, // use css for icons or direct img links, added in 5.0 arrow_ff_fix: (navigator.userAgent.indexOf("MSIE") >= 0 && document.compatMode=="BackCompat"), // border fixer for FF for arrows polygons live_id: window.dhx4.newId(), tags: { root: "menu", item: "item", text_ext: "itemtext", userdata: "userdata", tooltip: "tooltip", hotkey: "hotkey", href: "href" }, autoload: {}, hide_tm: {}, // shows sublevel polygons from toplevel items with delay top_mode: true, top_tmtime: 200, // visible area v_enabled: false, v: {x1: null, x2: null, y1: null, y2: null}, // open direction dir_toplv: "bottom", dir_sublv: "right", // overflow auto_overflow: false, overflow_limit: 0, of_utm: null, // scroll up - tm of_utime: 20, // scroll up - time of_ustep: 3, // scroll up - step of_dtm: null, of_dtime: 20, of_dstep: 3, of_ah: {dhx_skyblue: 24, dhx_web: 25, dhx_terrace: 27, material: 25}, // arrow height+oplygon top/bottom padding of_ih: {dhx_skyblue: 24, dhx_web: 24, dhx_terrace: 24, material: 30}, // item height // hide tm_sec: 400, tm_handler: null, // dyn load dload: false, dload_url: "", dload_icon: false, // show loading icon dload_params: {action: "loadMenu"}, // extra params dload_pid: "parentId", // parentId param name // skinbased offsets tl_botmarg: 1, // top level bottom margin tl_rmarg: 0, // right margin tl_ofsleft: 1, // offset left // context menu context: false, ctx_zoneid: false, ctx_autoshow: true, // default open action ctx_autohide: true, // default close action ctx_hideall: true, // true will hide all opened contextual menu polygons on mouseout, false - all except topleft ctx_zones: {}, ctx_baseid: null, // add baseId as context zone // selected subitems selected_sub: [], opened_poly: [] } if (typeof(base) == "object" && base != null && typeof(base.tagName) == "undefined") { // object-api init if (base.icons_path != null || base.icon_path != null) this.conf.icons_path = (base.icons_path||base.icon_path); if (base.skin != null) this.conf.skin = base.skin; if (base.visible_area) { this.conf.v_enabled = true; this.conf.v = { x1: base.visible_area.x1, x2: base.visible_area.x2, y1: base.visible_area.y1, y2: base.visible_area.y2 }; } for (var a in {json:1,xml:1,items:1,top_text:1,align:1,open_mode:1,overflow:1,dynamic:1,dynamic_icon:1,context:1,onload:1,onclick:1,oncheckboxclick:1,onradioclick:1,iconset:1}) { if (base[a] != null) this.conf.autoload[a] = base[a]; } base = base.parent; } if (base == null) { this.base = document.body; } else { var baseObj = (typeof(base)=="string"?document.getElementById(base):base); if (baseObj != null) { this.base = baseObj; if (!this.base.id) this.base.id = "menuBaseId_"+new Date().getTime(); this.base.className += " dhtmlxMenu_"+this.conf.skin+"_Middle dir_left"; this.base._autoSkinUpdate = true; // preserv default oncontextmenu for future restorin in case of context menu if (this.base.oncontextmenu) this.base._oldContextMenuHandler = this.base.oncontextmenu; // this.conf.ctx_baseid = this.base; this.base.onselectstart = function(e) { e = e || event; if (e.preventDefault) e.preventDefault(); else e.returnValue = false; return false; } this.base.oncontextmenu = function(e) { e = e || event; if (e.preventDefault) e.preventDefault(); else e.returnValue = false; return false; } } else { this.base = document.body; } } this.idPrefix = ""; this.topId = "dhxWebMenuTopId"; this.idPull = {}; this.itemPull = {}; this.userData = {}; this.radio = {}; // this.setSkin = function(skin) { var oldSkin = this.conf.skin; this.conf.skin = skin; switch (this.conf.skin){ case "dhx_skyblue": case "dhx_web": this.conf.tl_botmarg = 2; this.conf.tl_rmarg = 1; this.conf.tl_ofsleft = 1; break; case "dhx_terrace": case "material": this.conf.tl_botmarg = 0; this.conf.tl_rmarg = 0; this.conf.tl_ofsleft = 0; break; } if (this.base._autoSkinUpdate) { this.base.className = this.base.className.replace("dhtmlxMenu_"+oldSkin+"_Middle", "")+" dhtmlxMenu_"+this.conf.skin+"_Middle"; } for (var a in this.idPull) { this.idPull[a].className = String(this.idPull[a].className).replace(oldSkin, this.conf.skin); } } this.setSkin(this.conf.skin); // this._addSubItemToSelected = function(item, polygon) { var t = true; for (var q=0; q