calendar update
This commit is contained in:
parent
ea76fed699
commit
0b53fc0566
1 changed files with 16 additions and 9 deletions
|
@ -635,12 +635,11 @@ Ox.Calendar = function(options, self) {
|
|||
}
|
||||
|
||||
function getOverlayWidths() {
|
||||
var width = that.width() || self.options.width,
|
||||
centerWidth = Math.round(width / getScrollbarFactor());
|
||||
var width = Math.round(self.options.width / getScrollbarFactor());
|
||||
return [
|
||||
Math.floor((width - centerWidth) / 2),
|
||||
centerWidth,
|
||||
Math.ceil((width - centerWidth) / 2),
|
||||
Math.floor((self.options.width - width) / 2),
|
||||
width,
|
||||
Math.ceil((self.options.width - width) / 2),
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -776,7 +775,6 @@ Ox.Calendar = function(options, self) {
|
|||
}
|
||||
|
||||
function panTo(date, line) {
|
||||
Ox.print('panning???')
|
||||
var delta = Math.round((date - self.options.date) / 1000 * getPixelsPerSecond()),
|
||||
// 250 ms for half the width of the visible area
|
||||
ms = 250 * Math.min(Math.abs(delta) / (self.$content.width() / 2), 1);
|
||||
|
@ -976,7 +974,7 @@ Ox.Calendar = function(options, self) {
|
|||
self.options.selected = id;
|
||||
($element || getEventElementById(id)).addClass('OxSelected');
|
||||
// fixme: map event should also be 'select', not 'selectplace'
|
||||
that.triggerEvent('select', {id: id});
|
||||
that.triggerEvent('select', Ox.getObjectById(self.options.events, id));
|
||||
} else {
|
||||
if (self.options.selected !== '') {
|
||||
self.options.selected = '';
|
||||
|
@ -996,7 +994,7 @@ Ox.Calendar = function(options, self) {
|
|||
}
|
||||
} else {
|
||||
selectEvent('');
|
||||
panTo(getMouseDate(e));
|
||||
panTo(getMouseDate(data));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1045,12 +1043,21 @@ Ox.Calendar = function(options, self) {
|
|||
}
|
||||
};
|
||||
|
||||
that.panToEvent = function() {
|
||||
panToSelected();
|
||||
};
|
||||
|
||||
that.resizeCalendar = function() {
|
||||
self.$zoomInput.options({size: that.width()});
|
||||
self.options.width = that.width();
|
||||
self.$zoomInput.options({size: self.options.width});
|
||||
getLines();
|
||||
renderCalendar();
|
||||
};
|
||||
|
||||
that.zoomToEvent = function() {
|
||||
zoomToSelected();
|
||||
};
|
||||
|
||||
return that;
|
||||
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue