Browse Source

Fixed #664: end of item not restored when canceling a move event

v3_develop
jos 9 years ago
parent
commit
274a2d7d9d
2 changed files with 10 additions and 2 deletions
  1. +1
    -0
      HISTORY.md
  2. +9
    -2
      lib/timeline/component/ItemSet.js

+ 1
- 0
HISTORY.md View File

@ -23,6 +23,7 @@ http://visjs.org
- Fixed not property initializing with a DataView for groups.
- Merged add custom timebar functionality, thanks @aytech!
- Fixed #664: end of item not restored when canceling a move event.
## 2015-02-11, version 3.10.0

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

@ -1229,8 +1229,15 @@ ItemSet.prototype._onDrag = function (event) {
*/
ItemSet.prototype._updateItemProps = function(item, props) {
// TODO: copy all properties from props to item? (also new ones)
if ('start' in props) item.data.start = props.start;
if ('end' in props) item.data.end = props.end;
if ('start' in props) {
item.data.start = props.start;
}
if ('end' in props) {
item.data.end = props.end;
}
else if ('duration' in props) {
item.data.end = new Date(props.start.valueOf() + props.duration);
}
if ('group' in props && item.data.group != props.group) {
this._moveToGroup(item, props.group)
}

Loading…
Cancel
Save