diff --git a/lib/timeline/component/ItemSet.js b/lib/timeline/component/ItemSet.js index 0760ddef..a96c3ac4 100644 --- a/lib/timeline/component/ItemSet.js +++ b/lib/timeline/component/ItemSet.js @@ -1419,9 +1419,11 @@ ItemSet.prototype._onAddItem = function (event) { if (!this.options.selectable) return; if (!this.options.editable.add) return; - var me = this, - snap = this.options.snap || null, - item = this.itemFromTarget(event); + var me = this; + var snap = this.options.snap || null; + var item = this.itemFromTarget(event); + + event.stopPropagation(); if (item) { // update item diff --git a/lib/timeline/component/item/Item.js b/lib/timeline/component/item/Item.js index 7cc97d27..28d7dae5 100644 --- a/lib/timeline/component/item/Item.js +++ b/lib/timeline/component/item/Item.js @@ -144,8 +144,8 @@ Item.prototype._repaintDeleteButton = function (anchor) { // TODO: be able to destroy the delete button new Hammer(deleteButton).on('tap', function (event) { - me.parent.removeFromDataSet(me); event.stopPropagation(); + me.parent.removeFromDataSet(me); }); anchor.appendChild(deleteButton);