diff --git a/HISTORY.md b/HISTORY.md index 8dd044ac..e22310f4 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -11,6 +11,7 @@ http://visjs.org ### Timeline - Added axis orientation option `'none'`. +- Added a property `event` to the properties emitted with the `select` event (see #923). - Improved function `fit()` to take into account the actual width of items. - Fixed #897: Timeline option `{snap: null}` did give a validation error. diff --git a/docs/timeline/index.html b/docs/timeline/index.html index eb1c058f..eaa79b60 100644 --- a/docs/timeline/index.html +++ b/docs/timeline/index.html @@ -1256,6 +1256,7 @@ timeline.off('select', onSelect); Fired after the user selects or deselects items by tapping or holding them. diff --git a/lib/timeline/component/ItemSet.js b/lib/timeline/component/ItemSet.js index 1c3d6c7b..43c27871 100644 --- a/lib/timeline/component/ItemSet.js +++ b/lib/timeline/component/ItemSet.js @@ -1405,7 +1405,8 @@ ItemSet.prototype._onSelectItem = function (event) { // except when old selection is empty and new selection is still empty if (newSelection.length > 0 || oldSelection.length > 0) { this.body.emitter.emit('select', { - items: newSelection + items: newSelection, + event: event }); } }; @@ -1530,7 +1531,8 @@ ItemSet.prototype._onMultiSelectItem = function (event) { this.setSelection(selection); this.body.emitter.emit('select', { - items: this.getSelection() + items: this.getSelection(), + event: event }); } };