From 3028c145798c254955fd3fd241838153f416c4bd Mon Sep 17 00:00:00 2001 From: yotamberk Date: Sat, 15 Apr 2017 23:47:49 +0300 Subject: [PATCH 1/2] Fix #2679 (#2973) * Fix redraw order * Fix error when option is not defined * Allow template labels * Add .travis.yml file * Add experiment travis code * Fix react example * Make selectiveExtend accept null/undefined parameters --- lib/util.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/util.js b/lib/util.js index cfbfbaf5..24e2641a 100644 --- a/lib/util.js +++ b/lib/util.js @@ -188,7 +188,7 @@ exports.selectiveExtend = function (props, a, b) { for (var p = 0; p < props.length; p++) { var prop = props[p]; - if (other.hasOwnProperty(prop)) { + if (other && other.hasOwnProperty(prop)) { a[prop] = other[prop]; } } From b4967176956f1cd18d3b1a207c13d8f5fc61017a Mon Sep 17 00:00:00 2001 From: yotamberk Date: Mon, 17 Apr 2017 11:50:21 +0300 Subject: [PATCH 2/2] Fix doubleclick add (#2987) * Fix redraw order * Fix error when option is not defined * Allow template labels * Add .travis.yml file * Add experiment travis code * Fix react example * Fix adding items with double click --- lib/timeline/component/ItemSet.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/timeline/component/ItemSet.js b/lib/timeline/component/ItemSet.js index 76f89e4b..fe2b46f6 100644 --- a/lib/timeline/component/ItemSet.js +++ b/lib/timeline/component/ItemSet.js @@ -2044,6 +2044,10 @@ ItemSet.prototype._onAddItem = function (event) { newItemData.end = snap ? snap(end, scale, step) : end; } } else { + newItemData = { + start: snap ? snap(start, scale, step) : start, + content: 'new item' + }; newItemData[this.itemsData._fieldId] = util.randomUUID(); // when default type is a range, add a default end date to the new item