Permalink
Browse files

bug 817755: Further tweak calendar week event bar height calculation,…

… a=lightsofapollo
  • Loading branch information...
1 parent bc1710b commit 103c09542f4478f260fb6b9ae9c378cb6a4d7e10 @lmorchard lmorchard committed Dec 5, 2012
Showing with 6 additions and 2 deletions.
  1. +5 −1 apps/calendar/js/views/week_child.js
  2. +1 −1 apps/calendar/test/unit/views/week_child_test.js
@@ -46,7 +46,11 @@ Calendar.ns('Views').WeekChild = (function() {
*/
_assignHeight: function(element, hoursDuration) {
var percHeight = hoursDuration * 100;
- var pxHeight = hoursDuration * 2;
+
+ // TODO: This is a magic calculation based on current CSS. Fix this so
+ // that it can be dynamic based on CSS, or fix CSS to not need this.
+ var pxHeight = (hoursDuration * 2) - 5;
+
element.style.height = 'calc(' + percHeight + '% + ' + pxHeight + 'px)';
},
@@ -69,7 +69,7 @@ suite('views/week_child', function() {
subject.date = new Date(2012, 0, 1);
subject._assignPosition(busy, el);
- assert.equal(el.style.height, 'calc(325% + 6.5px)', 'height');
+ assert.equal(el.style.height, 'calc(325% + 1.5px)', 'height');
});
test('#create', function() {

0 comments on commit 103c095

Please sign in to comment.