[FIX] Kanban view action menu reaches edge of window on rightmost column

bzr revid: fme@openerp.com-20120523155810-0r825p2fi9irlo6h
This commit is contained in:
Fabien Meghazi 2012-05-23 17:58:10 +02:00
parent 6c2240c4c1
commit 0310c410fa
1 changed files with 11 additions and 2 deletions

View File

@ -41,9 +41,18 @@ instance.web_kanban.KanbanView = instance.web.View.extend({
// Bind kanban cards dropdown menus
this.$element.on('click', '.oe_kanban_menuaction', function() {
var $menu = $(this).next('.oe_kanban_menu');
var toggle = $menu.is(':visible');
var show = !$menu.is(':visible');
self.$element.find('.oe_kanban_menu').hide();
$menu.toggle(!toggle);
var doc_width = $(document).width();
$menu.toggle(show);
if (show) {
var offset = $menu.offset();
var menu_width = $menu.width();
var x = doc_width - offset.left - menu_width - 15;
if (x < 0) {
$menu.offset({ left: offset.left + x }).width(menu_width);
}
}
return false;
});
$('html').on('click', function() {