Browse Source

Fixed #172: auto detected item type being preferred over the global item `type`.

css_transitions
jos 10 years ago
parent
commit
468e613a26
2 changed files with 3 additions and 5 deletions
  1. +1
    -0
      HISTORY.md
  2. +2
    -5
      src/timeline/component/ItemSet.js

+ 1
- 0
HISTORY.md View File

@ -6,6 +6,7 @@ http://visjs.org
### Timeline
- Fixed auto detected item type being preferred over the global item `type`.
- Throws an error when constructing without new keyword.
### Graph

+ 2
- 5
src/timeline/component/ItemSet.js View File

@ -13,7 +13,7 @@ function ItemSet(body, options) {
this.body = body;
this.defaultOptions = {
type: 'box',
type: null, // 'box', 'point', 'range', 'rangeoverflow'
orientation: 'bottom', // 'top' or 'bottom'
align: 'center', // alignment of box items
stack: true,
@ -673,10 +673,7 @@ ItemSet.prototype._onUpdate = function(ids) {
ids.forEach(function (id) {
var itemData = me.itemsData.get(id, me.itemOptions),
item = me.items[id],
type = itemData.type ||
(itemData.start && itemData.end && 'range') ||
me.options.type ||
'box';
type = itemData.type || me.options.type || (itemData.end ? 'range' : 'box');
var constructor = ItemSet.types[type];

Loading…
Cancel
Save