[IMP] Move kanban dropdown offset to global dropdown handler

bzr revid: fme@openerp.com-20120620150304-muf0js0nu0cjhzk0
This commit is contained in:
Fabien Meghazi 2012-06-20 17:03:04 +02:00
parent 036a142b6d
commit 63fa49c18d
1 changed files with 10 additions and 0 deletions

View File

@ -868,6 +868,16 @@ instance.web.WebClient = instance.web.Widget.extend({
setTimeout(function() {
// Do not alter propagation
$menu.toggleClass('oe_opened', !state);
if (!state) {
// Move $menu if outside window's edge
var doc_width = $(document).width();
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);
}
}
}, 0);
});
instance.web.bus.on('click', this, function() {