1 | var menu_action = { |
---|
2 | |
---|
3 | "delay_hide" : 500, |
---|
4 | "delayhide" : false, |
---|
5 | |
---|
6 | "menu" : function() |
---|
7 | { |
---|
8 | try |
---|
9 | { |
---|
10 | var pElement = arguments[0]; |
---|
11 | delete arguments[0]; |
---|
12 | var pMenu = ( func.isString(arguments[1]) ) ? arguments[1] : arguments; |
---|
13 | if ( document.getElementById(pElement).innerHTML == "" ) |
---|
14 | { |
---|
15 | func.confEl(pElement, 'style', 'display:block'); |
---|
16 | this.layout(pMenu, pElement); |
---|
17 | } |
---|
18 | else |
---|
19 | { |
---|
20 | func.confEl(pElement, 'style', 'display:none;'); |
---|
21 | this.del_innerHTML(pElement); |
---|
22 | this.clear_delayhide(); |
---|
23 | } |
---|
24 | }catch(e){} |
---|
25 | }, |
---|
26 | |
---|
27 | "layout" : function(pHtml, pElement) |
---|
28 | { |
---|
29 | var _this = this; |
---|
30 | var el_dest_ = ( func.isString(pElement) ) ? func.byId(pElement) : pElement; |
---|
31 | var div_menu = func.newEl("div"); |
---|
32 | func.confEl(div_menu, 'style', 'padding:0px;border:1px solid #809aa9; background: #b4cfe5; font: 9pt Verdana, Arial, Helvetica, sans-serif;'); |
---|
33 | div_menu.onmouseover = function(){_this.clear_delayhide();}; |
---|
34 | div_menu.onmouseout = function(){_this.resetit(pElement);}; |
---|
35 | if ( func.isString(pHtml) ) |
---|
36 | div_menu.innerHTML = pHtml; |
---|
37 | else |
---|
38 | { |
---|
39 | for ( i = 1; i < pHtml.length; i++ ) |
---|
40 | func.insEl(pHtml[i], div_menu); |
---|
41 | } |
---|
42 | func.insEl(div_menu, el_dest_); |
---|
43 | this.delayhide = setTimeout("menu_action.del_innerHTML('"+pElement+"')", 2000); |
---|
44 | }, |
---|
45 | |
---|
46 | "del_innerHTML": function(pElement) |
---|
47 | { |
---|
48 | func.confEl(pElement, 'style', 'display:none;'); |
---|
49 | func.byId(pElement).innerHTML = ""; |
---|
50 | document.oncontextmenu = new Function("return true"); |
---|
51 | }, |
---|
52 | |
---|
53 | "resetit": function(pElement) |
---|
54 | { |
---|
55 | this.delayhide = setTimeout("menu_action.del_innerHTML('"+pElement+"')",this.delay_hide); |
---|
56 | }, |
---|
57 | |
---|
58 | "clear_delayhide" : function() |
---|
59 | { |
---|
60 | if ( this.delayhide ) |
---|
61 | clearTimeout(this.delayhide); |
---|
62 | } |
---|
63 | } |
---|