--- redmine_old/public/javascripts/context_menu.js 2017-10-16 01:00:00.000000000 +0500 +++ redmine_new/public/javascripts/context_menu.js 2017-11-29 15:56:31.674827000 +0500 @@ -85,6 +85,9 @@ } function contextMenuShow(event) { + var $wrapper = $("div#main"); + var wrapper_height = $wrapper.height(); + var mouse_x = event.pageX; var mouse_y = event.pageY; var mouse_y_c = event.clientY; @@ -115,11 +118,14 @@ menu_height = $('#context-menu').height(); max_width = mouse_x + 2*menu_width; max_height = mouse_y_c + menu_height; - + var ws = window_size(); window_width = ws.width; window_height = ws.height; - + + if (window_height > wrapper_height){ + window_height = wrapper_height + } /* display the menu above and/or to the left of the click if needed */ if (max_width > window_width) { render_x -= menu_width;