From 95c1ef38146f5053eb745fb46d31360c167682ab Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Tue, 20 Aug 2013 13:27:46 +0200 Subject: [PATCH] Improved task size calculation. --- .../javascripts/app/controllers/task_widget.js.coffee | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/app/assets/javascripts/app/controllers/task_widget.js.coffee b/app/assets/javascripts/app/controllers/task_widget.js.coffee index 3936f16bf..8b1e6c25d 100644 --- a/app/assets/javascripts/app/controllers/task_widget.js.coffee +++ b/app/assets/javascripts/app/controllers/task_widget.js.coffee @@ -208,19 +208,18 @@ class Taskbar extends App.Controller @navigate '#' resizeTasks: -> - width = $('#task .taskbar').width() - $('#task .taskbar-new').width() - 200 + width = $('#task .taskbar-items').width()# - $('#task .taskbar-new').width() - 200 task_count = App.TaskManager.all().length - task_size = ( width / task_count ) - ( task_count * 1.3 ) - + task_size = ( width / task_count ) - 44 elementsOversize = 0 elementsOversizeLeftTotal = 0 $('#task .task').each( (position, element) -> - width = $(element).parent().width() - if width > task_size + widthTask = $(element).parent().width() + if widthTask > task_size elementsOversize++ else - elementsOversizeLeftTotal += task_size - width + elementsOversizeLeftTotal += ( width / task_count ) - widthTask ) addOversize = elementsOversizeLeftTotal / elementsOversize