1
0
Fork 0
forked from 0x2620/oxjs

only draw half of the calendar background stripes

This commit is contained in:
rolux 2011-05-27 09:58:03 +02:00
commit 1950b514b5
3 changed files with 16 additions and 14 deletions

View file

@ -640,16 +640,18 @@ Ox.Calendar = function(options, self) {
width = unit.seconds * getPixelsPerSecond(zoom),
n = Math.ceil(self.options.width * 1.5/* * 16*/ / width);
Ox.loop(-n, n + 1, function(i) {
$elements.push(
new Ox.Element()
.addClass(
u == 0 ? 'line' : Ox.mod(value + i, 2) == 0 ? 'even' : 'odd'
)
.css({
left: getPosition(unit.date(value + i), zoom) + 'px',
width: (u == 0 ? 1 : width) + 'px'
})
);
if (u == 0 || Ox.mod(value + i, 2)) {
$elements.push(
new Ox.Element()
.addClass(
u == 0 ? 'line' : ''
)
.css({
left: getPosition(unit.date(value + i), zoom) + 'px',
width: (u == 0 ? 1 : width) + 'px'
})
);
}
});
});
return $elements;