summaryrefslogtreecommitdiffstats
path: root/public
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2016-04-24 10:25:33 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2016-04-24 10:25:33 +0000
commitab34455cdd5691b67119cf8ed41e0b7fc2822397 (patch)
treefc459a91e0f93c0f10ec32a0de38bd8abe87ffdf /public
parent66b9add002ab4616929f06bfef3197e23ed695fd (diff)
downloadredmine-ab34455cdd5691b67119cf8ed41e0b7fc2822397.tar.gz
redmine-ab34455cdd5691b67119cf8ed41e0b7fc2822397.zip
Issue percentage selector extends screen border (#22059).
Patch by Antonina Lebedeva. git-svn-id: http://svn.redmine.org/redmine/trunk@15349 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'public')
-rw-r--r--public/javascripts/context_menu.js18
-rw-r--r--public/stylesheets/context_menu.css6
2 files changed, 19 insertions, 5 deletions
diff --git a/public/javascripts/context_menu.js b/public/javascripts/context_menu.js
index 1b7da8991..ca2a9bec9 100644
--- a/public/javascripts/context_menu.js
+++ b/public/javascripts/context_menu.js
@@ -87,7 +87,8 @@ function contextMenuCreate() {
function contextMenuShow(event) {
var mouse_x = event.pageX;
- var mouse_y = event.pageY;
+ var mouse_y = event.pageY;
+ var mouse_y_c = event.clientY;
var render_x = mouse_x;
var render_y = mouse_y;
var dims;
@@ -110,7 +111,7 @@ function contextMenuShow(event) {
menu_width = $('#context-menu').width();
menu_height = $('#context-menu').height();
max_width = mouse_x + 2*menu_width;
- max_height = mouse_y + menu_height;
+ max_height = mouse_y_c + menu_height;
var ws = window_size();
window_width = ws.width;
@@ -123,12 +124,22 @@ function contextMenuShow(event) {
} else {
$('#context-menu').removeClass('reverse-x');
}
+
if (max_height > window_height) {
render_y -= menu_height;
$('#context-menu').addClass('reverse-y');
+ // adding class for submenu
+ if (mouse_y_c < 325) {
+ $('#context-menu .folder').addClass('down');
+ }
} else {
- $('#context-menu').removeClass('reverse-y');
+ // adding class for submenu
+ if (window_height - mouse_y_c < 345) {
+ $('#context-menu .folder').addClass('up');
+ }
+ $('#context-menu').removeClass('reverse-y');
}
+
if (render_x <= 0) render_x = 1;
if (render_y <= 0) render_y = 1;
$('#context-menu').css('left', (render_x + 'px'));
@@ -136,7 +147,6 @@ function contextMenuShow(event) {
$('#context-menu').show();
//if (window.parseStylesheets) { window.parseStylesheets(); } // IE
-
}
});
}
diff --git a/public/stylesheets/context_menu.css b/public/stylesheets/context_menu.css
index 1d02ebfba..2b9799387 100644
--- a/public/stylesheets/context_menu.css
+++ b/public/stylesheets/context_menu.css
@@ -25,10 +25,14 @@
#context-menu li.folder ul { position:absolute; left:168px; /* IE6 */ top:-2px; max-height:300px; overflow:hidden; overflow-y: auto; }
#context-menu li.folder>ul { left:148px; }
-#context-menu.reverse-y li.folder>ul { top:auto; bottom:0; }
+#context-menu.reverse-y li.folder>ul, #context-menu li.folder.up>ul { top:auto; bottom:0; }
#context-menu.reverse-x li.folder ul { left:auto; right:168px; /* IE6 */ }
#context-menu.reverse-x li.folder>ul { right:148px; }
+#context-menu.reverse-y li.folder.down>ul {
+ position:absolute; top:-2px; bottom: auto; max-height:300px; overflow:hidden; overflow-y: auto;
+}
+
#context-menu a {
text-decoration:none !important;
background-repeat: no-repeat;