forked from 0x2620/oxjs
some bugfixes
This commit is contained in:
parent
4cc754a28d
commit
ef1fa5fe84
14 changed files with 228 additions and 229 deletions
|
|
@ -425,8 +425,8 @@ Ox.Calendar = function(options, self) {
|
|||
renderCalendar();
|
||||
}
|
||||
|
||||
function doubleclick(event, e) {
|
||||
var $target = $(e.target),
|
||||
function doubleclick(data) {
|
||||
var $target = $(data.target),
|
||||
id = $target.data('id');
|
||||
if ($target.is('.OxLine > .OxEvent')) {
|
||||
selectEvent(id, $target);
|
||||
|
|
@ -442,19 +442,19 @@ Ox.Calendar = function(options, self) {
|
|||
}
|
||||
}
|
||||
|
||||
function dragstart(event, e) {
|
||||
function dragstart(data) {
|
||||
//if ($(e.target).is(':not(.OxLine > .OxEvent)')) {
|
||||
self.drag = {
|
||||
top: self.$container.$element[0].scrollTop,
|
||||
x: e.clientX
|
||||
x: data.clientX
|
||||
};
|
||||
//}
|
||||
}
|
||||
|
||||
function drag(event, e) {
|
||||
function drag(data) {
|
||||
if (self.drag) {
|
||||
///*
|
||||
var marginLeft = e.clientX - self.drag.x,
|
||||
var marginLeft = data.clientX - self.drag.x,
|
||||
scrollbarFactor = getScrollbarFactor();
|
||||
self.$scalebar.css({
|
||||
marginLeft: marginLeft + 'px'
|
||||
|
|
@ -465,42 +465,42 @@ Ox.Calendar = function(options, self) {
|
|||
self.$scrollbar.css({
|
||||
marginLeft: Math.round(marginLeft / scrollbarFactor) + 'px'
|
||||
});
|
||||
scrollTo(self.drag.top - e.clientDY);
|
||||
scrollTo(self.drag.top - data.clientDY);
|
||||
// fixme: after dragging too far in one direction,
|
||||
// dragging in the opposite direction should work immediately
|
||||
}
|
||||
}
|
||||
|
||||
function dragpause(event, e) {
|
||||
function dragpause(data) {
|
||||
if (self.drag) {
|
||||
dragafter(e);
|
||||
self.drag.x = e.clientX;
|
||||
dragafter(data);
|
||||
self.drag.x = data.clientX;
|
||||
}
|
||||
}
|
||||
|
||||
function dragend(event, e) {
|
||||
function dragend(data) {
|
||||
if (self.drag) {
|
||||
dragafter(e);
|
||||
dragafter(data);
|
||||
self.drag = null;
|
||||
}
|
||||
}
|
||||
|
||||
function dragafter(e) {
|
||||
function dragafter(data) {
|
||||
self.$scalebar.css({marginLeft: 0});
|
||||
self.$content.css({marginLeft: 0});
|
||||
self.$scrollbar.css({marginLeft: 0});
|
||||
self.options.date = new Date(
|
||||
+self.options.date - (e.clientX - self.drag.x) * getSecondsPerPixel() * 1000
|
||||
+self.options.date - (data.clientX - self.drag.x) * getSecondsPerPixel() * 1000
|
||||
);
|
||||
renderCalendar();
|
||||
}
|
||||
|
||||
function dragstartScrollbar(event, e) {
|
||||
self.drag = {x: e.clientX};
|
||||
function dragstartScrollbar(data) {
|
||||
self.drag = {x: data.clientX};
|
||||
}
|
||||
|
||||
function dragScrollbar(event, e) {
|
||||
var marginLeft = e.clientX - self.drag.x,
|
||||
function dragScrollbar(data) {
|
||||
var marginLeft = data.clientX - self.drag.x,
|
||||
scrollbarFactor = getScrollbarFactor();
|
||||
self.$scalebar.css({
|
||||
marginLeft: (marginLeft * scrollbarFactor) + 'px'
|
||||
|
|
@ -513,23 +513,23 @@ Ox.Calendar = function(options, self) {
|
|||
});
|
||||
}
|
||||
|
||||
function dragpauseScrollbar(event, e) {
|
||||
dragafterScrollbar(e);
|
||||
self.drag = {x: e.clientX};
|
||||
function dragpauseScrollbar(data) {
|
||||
dragafterScrollbar(data);
|
||||
self.drag = {x: data.clientX};
|
||||
}
|
||||
|
||||
function dragendScrollbar(event, e) {
|
||||
dragafterScrollbar(e);
|
||||
function dragendScrollbar(data) {
|
||||
dragafterScrollbar(data);
|
||||
self.drag = null;
|
||||
}
|
||||
|
||||
function dragafterScrollbar(e) {
|
||||
function dragafterScrollbar(data) {
|
||||
// fixme: duplicated
|
||||
self.$scalebar.css({marginLeft: 0});
|
||||
self.$content.css({marginLeft: 0});
|
||||
self.$scrollbar.css({marginLeft: 0});
|
||||
self.options.date = new Date(
|
||||
+self.options.date + (self.drag.x - e.clientX) * getSecondsPerPixel() * 1000 * getScrollbarFactor()
|
||||
+self.options.date + (self.drag.x - data.clientX) * getSecondsPerPixel() * 1000 * getScrollbarFactor()
|
||||
);
|
||||
renderCalendar();
|
||||
}
|
||||
|
|
@ -984,8 +984,8 @@ Ox.Calendar = function(options, self) {
|
|||
}
|
||||
}
|
||||
|
||||
function singleclick(event, e) {
|
||||
var $target = $(e.target),
|
||||
function singleclick(data) {
|
||||
var $target = $(data.target),
|
||||
id = $target.data('id');
|
||||
if ($target.is('.OxLine > .OxEvent')) {
|
||||
if (id == self.options.selected) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue