Browse Source

Renamed Timeline.repaint() to Timeline.redraw() for consistency with the other visualizations

css_transitions
jos 10 years ago
parent
commit
157c8a9f34
3 changed files with 13 additions and 5 deletions
  1. +3
    -0
      HISTORY.md
  2. +2
    -2
      docs/timeline.html
  3. +8
    -3
      src/timeline/Timeline.js

+ 3
- 0
HISTORY.md View File

@ -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`.

+ 2
- 2
docs/timeline.html View File

@ -692,9 +692,9 @@ timeline.clear({options: true}); // clear options only
</tr>
<tr>
<td>repaint()</td>
<td>redraw()</td>
<td>none</td>
<td>Force a repaint of the Timeline. Can be useful to manually repaint when option autoResize=false.
<td>Force a redraw of the Timeline. Can be useful to manually redraw when option autoResize=false.
</td>
</tr>

+ 8
- 3
src/timeline/Timeline.js View File

@ -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?
}
});
}

Loading…
Cancel
Save