From 157c8a9f34b3dd3d7b590b716e54a6adbf6a6199 Mon Sep 17 00:00:00 2001 From: jos Date: Fri, 6 Jun 2014 12:02:00 +0200 Subject: [PATCH] Renamed Timeline.repaint() to Timeline.redraw() for consistency with the other visualizations --- HISTORY.md | 3 +++ docs/timeline.html | 4 ++-- src/timeline/Timeline.js | 11 ++++++++--- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index 4cf60751..4b203627 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -6,6 +6,9 @@ http://visjs.org ### Timeline +- Select event now triggers repeatedly when selecting an already selected item. +- Renamed `Timeline.repaint()` to `Timeline.redraw()` to be consistent with + the other visualisations of vis.js. - Fixed `Timeline.clear()` not resetting a configured `options.start` and `options.end`. diff --git a/docs/timeline.html b/docs/timeline.html index 74445571..179d11a1 100644 --- a/docs/timeline.html +++ b/docs/timeline.html @@ -692,9 +692,9 @@ timeline.clear({options: true}); // clear options only - repaint() + redraw() none - Force a repaint of the Timeline. Can be useful to manually repaint when option autoResize=false. + Force a redraw of the Timeline. Can be useful to manually redraw when option autoResize=false. diff --git a/src/timeline/Timeline.js b/src/timeline/Timeline.js index 961484dd..c362aa6c 100644 --- a/src/timeline/Timeline.js +++ b/src/timeline/Timeline.js @@ -602,13 +602,18 @@ Timeline.prototype.getWindow = function setWindow() { }; /** - * Force a repaint of the Timeline. Can be useful to manually repaint when + * Force a redraw of the Timeline. Can be useful to manually redraw when * option autoResize=false */ -Timeline.prototype.repaint = function repaint() { +Timeline.prototype.redraw = function redraw() { this.rootPanel.repaint(); }; +// TODO: deprecated since version 1.1.0, remove some day +Timeline.prototype.repaint = function repaint() { + throw new Error('Function repaint is deprecated. Use redraw instead.'); +}; + /** * Handle selecting/deselecting an item when tapping it * @param {Event} event @@ -693,7 +698,7 @@ Timeline.prototype._onAddItem = function (event) { this.options.onAdd(newItem, function (item) { if (item) { me.itemsData.add(newItem); - // TODO: need to trigger a repaint? + // TODO: need to trigger a redraw? } }); }