|
@ -338,13 +338,15 @@ Timeline.prototype.getItemRange = function() { |
|
|
* The event happened, whether clicked on an item, etc. |
|
|
* The event happened, whether clicked on an item, etc. |
|
|
*/ |
|
|
*/ |
|
|
Timeline.prototype.getEventProperties = function (event) { |
|
|
Timeline.prototype.getEventProperties = function (event) { |
|
|
var item = this.itemSet.itemFromTarget(event); |
|
|
|
|
|
var group = this.itemSet.groupFromTarget(event); |
|
|
|
|
|
var pageX = event.gesture ? event.gesture.center.pageX : event.pageX; |
|
|
|
|
|
var pageY = event.gesture ? event.gesture.center.pageY : event.pageY; |
|
|
|
|
|
|
|
|
var pageX = event.center ? event.center.x : event.pageX; |
|
|
|
|
|
var pageY = event.center ? event.center.y : event.pageY; |
|
|
var x = pageX - util.getAbsoluteLeft(this.dom.centerContainer); |
|
|
var x = pageX - util.getAbsoluteLeft(this.dom.centerContainer); |
|
|
var y = pageY - util.getAbsoluteTop(this.dom.centerContainer); |
|
|
var y = pageY - util.getAbsoluteTop(this.dom.centerContainer); |
|
|
|
|
|
|
|
|
|
|
|
var item = this.itemSet.itemFromTarget(event); |
|
|
|
|
|
var group = this.itemSet.groupFromTarget(event); |
|
|
|
|
|
var customTime = CustomTime.customTimeFromTarget(event); |
|
|
|
|
|
|
|
|
var snap = this.itemSet.options.snap || null; |
|
|
var snap = this.itemSet.options.snap || null; |
|
|
var scale = this.body.util.getScale(); |
|
|
var scale = this.body.util.getScale(); |
|
|
var step = this.body.util.getStep(); |
|
|
var step = this.body.util.getStep(); |
|
@ -354,10 +356,10 @@ Timeline.prototype.getEventProperties = function (event) { |
|
|
var element = util.getTarget(event); |
|
|
var element = util.getTarget(event); |
|
|
var what = null; |
|
|
var what = null; |
|
|
if (item != null) {what = 'item';} |
|
|
if (item != null) {what = 'item';} |
|
|
|
|
|
else if (customTime != null) {what = 'custom-time';} |
|
|
else if (util.hasParent(element, this.timeAxis.dom.foreground)) {what = 'axis';} |
|
|
else if (util.hasParent(element, this.timeAxis.dom.foreground)) {what = 'axis';} |
|
|
else if (this.timeAxis2 && util.hasParent(element, this.timeAxis2.dom.foreground)) {what = 'axis';} |
|
|
else if (this.timeAxis2 && util.hasParent(element, this.timeAxis2.dom.foreground)) {what = 'axis';} |
|
|
else if (util.hasParent(element, this.itemSet.dom.labelSet)) {what = 'group-label';} |
|
|
else if (util.hasParent(element, this.itemSet.dom.labelSet)) {what = 'group-label';} |
|
|
else if (CustomTime.customTimeFromTarget(event) != null) {what = 'custom-time';} |
|
|
|
|
|
else if (util.hasParent(element, this.currentTime.bar)) {what = 'current-time';} |
|
|
else if (util.hasParent(element, this.currentTime.bar)) {what = 'current-time';} |
|
|
else if (util.hasParent(element, this.dom.center)) {what = 'background';} |
|
|
else if (util.hasParent(element, this.dom.center)) {what = 'background';} |
|
|
|
|
|
|
|
|