From add74574206dcb6a7dc03f180d5d30f9785f97eb Mon Sep 17 00:00:00 2001 From: Andreas Haugstrup Pedersen Date: Wed, 9 Nov 2011 14:12:24 +0100 Subject: [PATCH] Fix height calculations when dragging --- public/board.css | 1 + public/scrumboard.js | 13 ++++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/public/board.css b/public/board.css index b48542f..3ccf5bb 100644 --- a/public/board.css +++ b/public/board.css @@ -161,6 +161,7 @@ other bg: #cbe8a5 } .story-item-state { height:100%; + min-height:62px; } .story-item { cursor:move; diff --git a/public/scrumboard.js b/public/scrumboard.js index ba17b52..1f48922 100644 --- a/public/scrumboard.js +++ b/public/scrumboard.js @@ -35,12 +35,18 @@ var states = $(current_id).find('.state'); var max_height = 0; states.each(function(){ - var current_height = $(this).height(); + var current_height = 0; + $(this).find('li').each(function(){ + if (!$(this).attr('style')) { + current_height += $(this).outerHeight(true); + } + }); + if (current_height > max_height) { max_height = current_height; } }); - states.height(max_height); + states.find('ul').height(max_height); } resize_stories(); @@ -73,7 +79,8 @@ if (state != old_state) { var item_id = $(ui.draggable).data('id'); $(this).append(ui.draggable); - // $(this).css('background', '#eee'); + + set_story_height('#'+$(this).parents('.story-group').attr('id')); // Make Ajax request to change state on Podio $(ui.draggable).append('
');