@@ -87,7 +87,8 function contextMenuCreate() { | |||||
87 |
|
87 | |||
88 | function contextMenuShow(event) { |
|
88 | function contextMenuShow(event) { | |
89 | var mouse_x = event.pageX; |
|
89 | var mouse_x = event.pageX; | |
90 | var mouse_y = event.pageY; |
|
90 | var mouse_y = event.pageY; | |
|
91 | var mouse_y_c = event.clientY; | |||
91 | var render_x = mouse_x; |
|
92 | var render_x = mouse_x; | |
92 | var render_y = mouse_y; |
|
93 | var render_y = mouse_y; | |
93 | var dims; |
|
94 | var dims; | |
@@ -110,7 +111,7 function contextMenuShow(event) { | |||||
110 | menu_width = $('#context-menu').width(); |
|
111 | menu_width = $('#context-menu').width(); | |
111 | menu_height = $('#context-menu').height(); |
|
112 | menu_height = $('#context-menu').height(); | |
112 | max_width = mouse_x + 2*menu_width; |
|
113 | max_width = mouse_x + 2*menu_width; | |
113 | max_height = mouse_y + menu_height; |
|
114 | max_height = mouse_y_c + menu_height; | |
114 |
|
115 | |||
115 | var ws = window_size(); |
|
116 | var ws = window_size(); | |
116 | window_width = ws.width; |
|
117 | window_width = ws.width; | |
@@ -123,12 +124,22 function contextMenuShow(event) { | |||||
123 | } else { |
|
124 | } else { | |
124 | $('#context-menu').removeClass('reverse-x'); |
|
125 | $('#context-menu').removeClass('reverse-x'); | |
125 | } |
|
126 | } | |
|
127 | ||||
126 | if (max_height > window_height) { |
|
128 | if (max_height > window_height) { | |
127 | render_y -= menu_height; |
|
129 | render_y -= menu_height; | |
128 | $('#context-menu').addClass('reverse-y'); |
|
130 | $('#context-menu').addClass('reverse-y'); | |
|
131 | // adding class for submenu | |||
|
132 | if (mouse_y_c < 325) { | |||
|
133 | $('#context-menu .folder').addClass('down'); | |||
|
134 | } | |||
129 | } else { |
|
135 | } else { | |
130 | $('#context-menu').removeClass('reverse-y'); |
|
136 | // adding class for submenu | |
|
137 | if (window_height - mouse_y_c < 345) { | |||
|
138 | $('#context-menu .folder').addClass('up'); | |||
|
139 | } | |||
|
140 | $('#context-menu').removeClass('reverse-y'); | |||
131 | } |
|
141 | } | |
|
142 | ||||
132 | if (render_x <= 0) render_x = 1; |
|
143 | if (render_x <= 0) render_x = 1; | |
133 | if (render_y <= 0) render_y = 1; |
|
144 | if (render_y <= 0) render_y = 1; | |
134 | $('#context-menu').css('left', (render_x + 'px')); |
|
145 | $('#context-menu').css('left', (render_x + 'px')); | |
@@ -136,7 +147,6 function contextMenuShow(event) { | |||||
136 | $('#context-menu').show(); |
|
147 | $('#context-menu').show(); | |
137 |
|
148 | |||
138 | //if (window.parseStylesheets) { window.parseStylesheets(); } // IE |
|
149 | //if (window.parseStylesheets) { window.parseStylesheets(); } // IE | |
139 |
|
||||
140 | } |
|
150 | } | |
141 | }); |
|
151 | }); | |
142 | } |
|
152 | } |
@@ -25,10 +25,14 | |||||
25 | #context-menu li.folder ul { position:absolute; left:168px; /* IE6 */ top:-2px; max-height:300px; overflow:hidden; overflow-y: auto; } |
|
25 | #context-menu li.folder ul { position:absolute; left:168px; /* IE6 */ top:-2px; max-height:300px; overflow:hidden; overflow-y: auto; } | |
26 | #context-menu li.folder>ul { left:148px; } |
|
26 | #context-menu li.folder>ul { left:148px; } | |
27 |
|
27 | |||
28 | #context-menu.reverse-y li.folder>ul { top:auto; bottom:0; } |
|
28 | #context-menu.reverse-y li.folder>ul, #context-menu li.folder.up>ul { top:auto; bottom:0; } | |
29 | #context-menu.reverse-x li.folder ul { left:auto; right:168px; /* IE6 */ } |
|
29 | #context-menu.reverse-x li.folder ul { left:auto; right:168px; /* IE6 */ } | |
30 | #context-menu.reverse-x li.folder>ul { right:148px; } |
|
30 | #context-menu.reverse-x li.folder>ul { right:148px; } | |
31 |
|
31 | |||
|
32 | #context-menu.reverse-y li.folder.down>ul { | |||
|
33 | position:absolute; top:-2px; bottom: auto; max-height:300px; overflow:hidden; overflow-y: auto; | |||
|
34 | } | |||
|
35 | ||||
32 | #context-menu a { |
|
36 | #context-menu a { | |
33 | text-decoration:none !important; |
|
37 | text-decoration:none !important; | |
34 | background-repeat: no-repeat; |
|
38 | background-repeat: no-repeat; |
General Comments 0
You need to be logged in to leave comments.
Login now