1
0
Fork 0
forked from 0x2620/oxjs

fix bugs in video editor; begin to implement new list map mode that allows for defining/clearing places

This commit is contained in:
rlx 2012-02-04 08:58:46 +00:00
commit 3c94f44a99
15 changed files with 437 additions and 255 deletions

View file

@ -357,7 +357,7 @@ Ox.Calendar = function(options, self) {
.addClass('OxCalendarContainer')
.css({
top: (self.options.showToolbar * 24) + 16 + 'px',
bottom: (self.options.showZoombar * 16) + 'px'
bottom: (self.options.showZoombar * 16) + 16 + 'px'
})
.bind({
mouseleave: mouseleave,
@ -1015,7 +1015,7 @@ Ox.Calendar = function(options, self) {
marginLeft: -delta / getScrollbarFactor() + 'px'
}, ms);
if (!Ox.isUndefined(line)) {
scrollTo((line + 1) * 16 - self.$container.height() / 2, true);
scrollTo(line * 16 + 8 - self.$container.height() / 2, true);
}
};
@ -1037,9 +1037,10 @@ Ox.Calendar = function(options, self) {
function renderCalendar() {
self.contentHeight = Math.max(
self.lineEvents.length * 16 + 16, // fixme: why +16 ?
self.options.height - (self.options.showToolbar * 24)
// self.options.height - 56 // 24 + 16 + 16
self.lineEvents.length * 16,
self.options.height - 32
- self.options.showZoombar * 16
- self.options.showToolbar * 24
);
self.$content.css({height: self.contentHeight + 'px'});
that.$element.find('.OxBackground').empty();
@ -1117,7 +1118,7 @@ Ox.Calendar = function(options, self) {
function scrollBy(delta) {
scrollTo(
self.$container.$element[0].scrollTop
+ delta * self.$container.height() / 2, true
+ delta * Math.round(self.$container.height() / 2), true
);
}
@ -1125,7 +1126,7 @@ Ox.Calendar = function(options, self) {
var containerHeight = self.$container.height(),
scrollTop = self.$container.$element[0].scrollTop,
min = 0,
max = Math.ceil(self.contentHeight - containerHeight / 2),
max = self.contentHeight - containerHeight,
top = Ox.limit(top, min, max),
delta = top - scrollTop,
ms = 250 * Math.min(Math.abs(delta) / (containerHeight / 2), 1);
@ -1144,14 +1145,11 @@ Ox.Calendar = function(options, self) {
if (id) {
self.options.selected = id;
$element = $element || getEventElementById(id);
if ($element) {
$element.addClass('OxSelected');
} else {
panToSelected();
}
$element && $element.addClass('OxSelected');
panToSelected();
event = Ox.getObjectById(self.options.events, id);
// fixme: map event should also be 'select', not 'selectplace'
setEventControls(event);
// fixme: map event should also be 'select', not 'selectplace'
that.triggerEvent('select', event);
} else {
if (self.options.selected !== '') {
@ -1324,7 +1322,6 @@ Ox.Calendar = function(options, self) {
};
that.resizeCalendar = function() {
Ox.print('RESIZE CALENDAR')
self.options.width = that.width();
self.options.height = that.height();
self.options.showZoombar && self.$zoomInput.options({size: self.options.width});