forked from 0x2620/oxjs
click selects, second click pans, doubleclick zooms
This commit is contained in:
parent
419985c835
commit
453f226b18
2 changed files with 19 additions and 2 deletions
|
|
@ -423,7 +423,12 @@ Ox.Calendar = function(options, self) {
|
|||
}
|
||||
|
||||
function doubleclick(event, e) {
|
||||
if ($(e.target).is(':not(.OxLine > .OxEvent)')) {
|
||||
var $target = $(e.target),
|
||||
id = $target.data('id');
|
||||
if ($target.is('.OxLine > .OxEvent')) {
|
||||
selectEvent(id, $target);
|
||||
zoomToSelected();
|
||||
} else {
|
||||
if (self.options.zoom < self.maxZoom) {
|
||||
self.options.date = new Date(
|
||||
(+self.options.date + +getMouseDate(e)) / 2
|
||||
|
|
@ -969,7 +974,11 @@ Ox.Calendar = function(options, self) {
|
|||
var $target = $(e.target),
|
||||
id = $target.data('id');
|
||||
if ($target.is('.OxLine > .OxEvent')) {
|
||||
selectEvent(id, $target);
|
||||
if (id == self.options.selected) {
|
||||
panToSelected();
|
||||
} else {
|
||||
selectEvent(id, $target);
|
||||
}
|
||||
} else {
|
||||
selectEvent('');
|
||||
panTo(getMouseDate(e));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue