Browse Source

Fixed #923: Added a property `event` to the properties emitted with the `select` event

flowchartTest
jos 9 years ago
parent
commit
7a417337c9
3 changed files with 6 additions and 2 deletions
  1. +1
    -0
      HISTORY.md
  2. +1
    -0
      docs/timeline/index.html
  3. +4
    -2
      lib/timeline/component/ItemSet.js

+ 1
- 0
HISTORY.md View File

@ -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.

+ 1
- 0
docs/timeline/index.html View File

@ -1256,6 +1256,7 @@ timeline.off('select', onSelect);
<td>
<ul>
<li><code>items</code>: an array with the ids of the selected items</li>
<li><code>event</code>: the original click event</li>
</ul>
</td>
<td>Fired after the user selects or deselects items by tapping or holding them.

+ 4
- 2
lib/timeline/component/ItemSet.js View File

@ -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
});
}
};

Loading…
Cancel
Save