diff --git a/lib/timeline/component/item/Item.js b/lib/timeline/component/item/Item.js index d7269bae..30c0bbc8 100644 --- a/lib/timeline/component/item/Item.js +++ b/lib/timeline/component/item/Item.js @@ -146,15 +146,25 @@ Item.prototype.repositionY = function() { Item.prototype._repaintDragCenter = function () { if (this.selected && this.options.editable.updateTime && !this.dom.dragCenter) { var me = this; - // create and show drag area var dragCenter = document.createElement('div'); dragCenter.className = 'vis-drag-center'; dragCenter.dragCenterItem = this; + var hammer = new Hammer(dragCenter); - new Hammer(dragCenter).on('doubletap', function (event) { + hammer.on('tap', function (event) { + me.parent.itemSet.body.emitter.emit('click', { + event: event, + item: me.id + }); + }); + hammer.on('doubletap', function (event) { event.stopPropagation(); me.parent.itemSet._onUpdateItem(me); + me.parent.itemSet.body.emitter.emit('doubleClick', { + event: event, + item: me.id + }); }); if (this.dom.box) { @@ -370,7 +380,6 @@ Item.prototype._updateContents = function (element) { throw new Error('Property "content" missing in item ' + this.id); } } - this.content = content; } }