fix a bug where the selected element would be too big if it was off the left side of the screen
This commit is contained in:
parent
dcb567143e
commit
eccade6aa9
1 changed files with 8 additions and 0 deletions
|
@ -590,6 +590,14 @@ Ox.Calendar = function(options, self) {
|
||||||
var left = Math.max(getPosition(event.startTime, zoom), -10000),
|
var left = Math.max(getPosition(event.startTime, zoom), -10000),
|
||||||
paddingLeft = (event.type && left < 0 ? -left : 0),
|
paddingLeft = (event.type && left < 0 ? -left : 0),
|
||||||
width = Ox.limit(getPosition(event.endTime, zoom) - left, 1, 20000) - paddingLeft;
|
width = Ox.limit(getPosition(event.endTime, zoom) - left, 1, 20000) - paddingLeft;
|
||||||
|
// selected element may be past the left edge of the screen
|
||||||
|
if (width < 0) {
|
||||||
|
paddingLeft = 0;
|
||||||
|
width = getPosition(event.endTime, zoom) - left;
|
||||||
|
}
|
||||||
|
if (event.name == 'Martin Luther') {
|
||||||
|
Ox.print('left', left, 'pL', paddingLeft, 'width', width)
|
||||||
|
}
|
||||||
return new Ox.Element()
|
return new Ox.Element()
|
||||||
.addClass('OxEvent' +
|
.addClass('OxEvent' +
|
||||||
(event.type ? ' Ox' + Ox.toTitleCase(event.type) : '' ) +
|
(event.type ? ' Ox' + Ox.toTitleCase(event.type) : '' ) +
|
||||||
|
|
Loading…
Reference in a new issue