Browse Source

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

revert-3409-performance
Yotam Berkowitz 7 years ago
parent
commit
0c27b50bed
2 changed files with 5 additions and 1 deletions
  1. +4
    -0
      lib/timeline/component/ItemSet.js
  2. +1
    -1
      lib/util.js

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

@ -2044,6 +2044,10 @@ ItemSet.prototype._onAddItem = function (event) {
newItemData.end = snap ? snap(end, scale, step) : end; newItemData.end = snap ? snap(end, scale, step) : end;
} }
} else { } else {
newItemData = {
start: snap ? snap(start, scale, step) : start,
content: 'new item'
};
newItemData[this.itemsData._fieldId] = util.randomUUID(); newItemData[this.itemsData._fieldId] = util.randomUUID();
// when default type is a range, add a default end date to the new item // when default type is a range, add a default end date to the new item

+ 1
- 1
lib/util.js View File

@ -188,7 +188,7 @@ exports.selectiveExtend = function (props, a, b) {
for (var p = 0; p < props.length; p++) { for (var p = 0; p < props.length; p++) {
var prop = props[p]; var prop = props[p];
if (other.hasOwnProperty(prop)) {
if (other && other.hasOwnProperty(prop)) {
a[prop] = other[prop]; a[prop] = other[prop];
} }
} }

Loading…
Cancel
Save