Skip to content

Commit

Permalink
fix: typescript error on new Item() (#208)
Browse files Browse the repository at this point in the history
  • Loading branch information
yotamberk authored Nov 23, 2019
1 parent 1907e89 commit 29ec257
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 15 deletions.
4 changes: 1 addition & 3 deletions lib/timeline/component/item/BackgroundItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class BackgroundItem extends Item {
* // TODO: implement support for the BackgroundItem just having a start, then being displayed as a sort of an annotation
*/
constructor(data, conversion, options) {
super()
super(data, conversion, options)
this.props = {
content: {
width: 0
Expand All @@ -35,8 +35,6 @@ class BackgroundItem extends Item {
throw new Error(`Property "end" missing in item ${data.id}`);
}
}

Item.call(this, data, conversion, options);
}

/**
Expand Down
4 changes: 1 addition & 3 deletions lib/timeline/component/item/BoxItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class BoxItem extends Item {
* // TODO: describe available options
*/
constructor(data, conversion, options) {
super()
super(data, conversion, options)
this.props = {
dot: {
width: 0,
Expand All @@ -32,8 +32,6 @@ class BoxItem extends Item {
throw new Error(`Property "start" missing in item ${data}`);
}
}

Item.call(this, data, conversion, options);
}

/**
Expand Down
6 changes: 3 additions & 3 deletions lib/timeline/component/item/ClusterItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ class ClusterItem extends Item {
* // TODO: describe available options
*/
constructor(data, conversion, options) {
super();
const modifiedOptions = Object.assign({}, {fitOnDoubleClick: true}, options, {editable: false});
super(data, conversion, modifiedOptions);

this.props = {
content: {
Expand All @@ -24,13 +25,12 @@ class ClusterItem extends Item {
},
};

this.options = Object.assign({}, {fitOnDoubleClick: true}, options, {editable: false});
this.options = modifiedOptions;

if (!data || data.uiItems == undefined) {
throw new Error('Property "uiItems" missing in item ' + data.id);
}

Item.call(this, data, conversion, this.options);
this.id = util.randomUUID();
this.group = data.group;
this._setupRange();
Expand Down
4 changes: 1 addition & 3 deletions lib/timeline/component/item/PointItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class PointItem extends Item {
* // TODO: describe available options
*/
constructor(data, conversion, options) {
super()
super(data, conversion, options)
this.props = {
dot: {
top: 0,
Expand All @@ -34,8 +34,6 @@ class PointItem extends Item {
throw new Error(`Property "start" missing in item ${data}`);
}
}

Item.call(this, data, conversion, options);
}

/**
Expand Down
4 changes: 1 addition & 3 deletions lib/timeline/component/item/RangeItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class RangeItem extends Item {
* // TODO: describe options
*/
constructor(data, conversion, options) {
super()
super(data, conversion, options)
this.props = {
content: {
width: 0
Expand All @@ -31,8 +31,6 @@ class RangeItem extends Item {
throw new Error(`Property "end" missing in item ${data.id}`);
}
}

Item.call(this, data, conversion, options);
}

/**
Expand Down

0 comments on commit 29ec257

Please sign in to comment.