瀏覽代碼

Fixed #1527: error when creating/updating a Timeline without data

codeClimate
jos 9 年前
父節點
當前提交
4cae296b17
共有 2 個檔案被更改,包括 4 行新增3 行删除
  1. +2
    -1
      HISTORY.md
  2. +2
    -2
      lib/timeline/Timeline.js

+ 2
- 1
HISTORY.md 查看文件

@ -4,8 +4,9 @@ http://visjs.org
## not yet released, version 4.11.1-SNAPSHOT ## not yet released, version 4.11.1-SNAPSHOT
### Timeline
- Fixed #1527: error when creating/updating a Timeline without data.
## 2015-12-18, version 4.11.0 ## 2015-12-18, version 4.11.0

+ 2
- 2
lib/timeline/Timeline.js 查看文件

@ -379,8 +379,8 @@ Timeline.prototype.fit = function (options) {
Timeline.prototype.getItemRange = function () { Timeline.prototype.getItemRange = function () {
// get a rough approximation for the range based on the items start and end dates // get a rough approximation for the range based on the items start and end dates
var range = this.getDataRange(); var range = this.getDataRange();
var min = range.min.valueOf();
var max = range.max.valueOf();
var min = range.min !== null ? range.min.valueOf() : null;
var max = range.max !== null ? range.max.valueOf() : null;
var minItem = null; var minItem = null;
var maxItem = null; var maxItem = null;

載入中…
取消
儲存