Browse Source

Merge branch 'develop' of https://github.com/almende/vis into develop

Conflicts:
	dist/vis.js
	dist/vis.map
	dist/vis.min.js
v3_develop
Alex de Mulder 10 years ago
parent
commit
16b712c5f5
6 changed files with 23895 additions and 23852 deletions
  1. +13
    -0
      HISTORY.md
  2. +23843
    -23828
      dist/vis.js
  3. +1
    -1
      dist/vis.map
  4. +11
    -11
      dist/vis.min.js
  5. +1
    -1
      docs/timeline.html
  6. +26
    -11
      lib/timeline/component/ItemSet.js

+ 13
- 0
HISTORY.md View File

@ -2,6 +2,19 @@
http://visjs.org
## not yet released, version 3.2.1
### Timeline
- Fixed the `change` event sometimes being fired twice on IE10.
- Fixed canceling moving an item to another group did not move the item
back to the original group.
### Network
- A fix in reading group properties for a node.
## 2014-08-14, version 3.2.0
### General

+ 23843
- 23828
dist/vis.js
File diff suppressed because it is too large
View File


+ 1
- 1
dist/vis.map
File diff suppressed because it is too large
View File


+ 11
- 11
dist/vis.min.js
File diff suppressed because it is too large
View File


+ 1
- 1
docs/timeline.html View File

@ -801,7 +801,7 @@ timeline.clear({options: true}); // clear options only
<tr>
<td>setSelection([ids])</td>
<td>none</td>
<td>Select or deselect items. Currently selected items will be unselected.
<td>Select one or multiple items by their id. The currently selected items will be unselected. To unselect all selected items, call `setSelection([])`.
</td>
</tr>

+ 26
- 11
lib/timeline/component/ItemSet.js View File

@ -1118,15 +1118,7 @@ ItemSet.prototype._onDrag = function (event) {
if ('group' in props) {
// drag from one group to another
var group = ItemSet.groupFromTarget(event);
if (group && group.groupId != props.item.data.group) {
var oldGroup = props.item.parent;
oldGroup.remove(props.item);
oldGroup.order();
group.add(props.item);
group.order();
props.item.data.group = group.groupId;
}
_moveToGroup(props.item, group);
}
});
@ -1139,6 +1131,24 @@ ItemSet.prototype._onDrag = function (event) {
}
};
/**
* Move an item to another group
* @param {Item} item
* @param {Group} group
* @private
*/
function _moveToGroup (item, group) {
if (group && group.groupId != item.data.group) {
var oldGroup = item.parent;
oldGroup.remove(item);
oldGroup.order();
group.add(item);
group.order();
item.data.group = group.groupId;
}
}
/**
* End of dragging selected items
* @param {Event} event
@ -1151,7 +1161,9 @@ ItemSet.prototype._onDragEnd = function (event) {
me = this,
dataset = this.itemsData.getDataSet();
this.touchParams.itemProps.forEach(function (props) {
var itemProps = this.touchParams.itemProps ;
this.touchParams.itemProps = null;
itemProps.forEach(function (props) {
var id = props.item.id,
itemData = me.itemsData.get(id, me.itemOptions);
@ -1183,6 +1195,10 @@ ItemSet.prototype._onDragEnd = function (event) {
// restore original values
if ('start' in props) props.item.data.start = props.start;
if ('end' in props) props.item.data.end = props.end;
if ('group' in props && props.item.data.group != props.group) {
var group = me.groups[props.group];
_moveToGroup(props.item, group);
}
me.stackDirty = true; // force re-stacking of all items next redraw
me.body.emitter.emit('change');
@ -1190,7 +1206,6 @@ ItemSet.prototype._onDragEnd = function (event) {
});
}
});
this.touchParams.itemProps = null;
// apply the changes to the data (if there are changes)
if (changes.length) {

Loading…
Cancel
Save