[FIX] Compute min-height for kanban view's cards in ungroupped mode in order to avoid...
authorFabien Meghazi <fme@openerp.com>
Wed, 9 May 2012 16:21:16 +0000 (18:21 +0200)
committerFabien Meghazi <fme@openerp.com>
Wed, 9 May 2012 16:21:16 +0000 (18:21 +0200)
bzr revid: fme@openerp.com-20120509162116-3f5bp2n720kvmsof

addons/web_kanban/static/src/js/kanban.js

index 928a06d..3040220 100644 (file)
@@ -355,8 +355,19 @@ instance.web_kanban.KanbanGroup = instance.web.OldWidget.extend({
         this.$element.data('widget', this);
         this.$records.data('widget', this);
         this.$has_been_started.resolve();
+        this.compute_cards_height();
         return def;
     },
+    compute_cards_height: function() {
+        var self = this;
+        var min_height = 0;
+        _.each(this.records, function(r) {
+            min_height = Math.max(min_height, r.$element.outerHeight());
+        });
+        _.each(this.records, function(r) {
+            r.$element.css('min-height', min_height);
+        });
+    },
     destroy: function() {
         this._super();
         if (this.$records) {