[IMP] Changed Kanban auto height algo

bzr revid: fme@openerp.com-20120816171306-czxohcujj2byatld
This commit is contained in:
Fabien Meghazi 2012-08-16 19:13:06 +02:00
parent 7d316b0829
commit 896b6991e6
1 changed files with 13 additions and 13 deletions

View File

@ -520,19 +520,19 @@ instance.web_kanban.KanbanGroup = instance.web.Widget.extend({
return def; return def;
}, },
compute_cards_auto_height: function() { compute_cards_auto_height: function() {
// oe_kanban_auto_height is an empty class used by the kanban view in order // oe_kanban_no_auto_height is an empty class used to disable this feature
// to normalize height amongst kanban cards. (by group) if (!this.view.group_by) {
var self = this; var min_height = 0;
var min_height = 0; var els = [];
var els = []; _.each(this.records, function(r) {
_.each(this.records, function(r) { var $e = r.$element.children(':first:not(.oe_kanban_no_auto_height)').css('min-height', 0);
var $e = r.$element.find('.oe_kanban_auto_height').first().css('min-height', 0); if ($e.length) {
if ($e.length) { els.push($e[0]);
els.push($e[0]); min_height = Math.max(min_height, $e.outerHeight());
min_height = Math.max(min_height, $e.outerHeight()); }
} });
}); $(els).css('min-height', min_height);
$(els).css('min-height', min_height); }
}, },
destroy: function() { destroy: function() {
this._super(); this._super();