diff --git a/lib/timeline/component/item/BackgroundItem.js b/lib/timeline/component/item/BackgroundItem.js index a4ec1bd94..21cf92d69 100644 --- a/lib/timeline/component/item/BackgroundItem.js +++ b/lib/timeline/component/item/BackgroundItem.js @@ -1,4 +1,3 @@ -var Hammer = require('../../../module/hammer'); var Item = require('./Item'); var BackgroundGroup = require('../BackgroundGroup'); var RangeItem = require('./RangeItem'); @@ -141,17 +140,14 @@ BackgroundItem.prototype.repositionX = RangeItem.prototype.repositionX; * Reposition the item vertically * @Override */ -BackgroundItem.prototype.repositionY = function(margin) { +BackgroundItem.prototype.repositionY = function(margin) { // eslint-disable-line no-unused-vars var height; var orientation = this.options.orientation.item; // special positioning for subgroups if (this.data.subgroup !== undefined) { // TODO: instead of calculating the top position of the subgroups here for every BackgroundItem, calculate the top of the subgroup once in Itemset - var itemSubgroup = this.data.subgroup; - var subgroups = this.parent.subgroups; - var subgroupIndex = subgroups[itemSubgroup].index; this.dom.box.style.height = this.parent.subgroups[itemSubgroup].height + 'px'; diff --git a/lib/timeline/component/item/BoxItem.js b/lib/timeline/component/item/BoxItem.js index aa2e1eea6..33a23eedc 100644 --- a/lib/timeline/component/item/BoxItem.js +++ b/lib/timeline/component/item/BoxItem.js @@ -1,5 +1,4 @@ var Item = require('./Item'); -var util = require('../../../util'); /** * @constructor BoxItem diff --git a/lib/timeline/component/item/Item.js b/lib/timeline/component/item/Item.js index cb16b7663..9dd4e055e 100644 --- a/lib/timeline/component/item/Item.js +++ b/lib/timeline/component/item/Item.js @@ -99,7 +99,7 @@ Item.prototype.setParent = function(parent) { * @returns {{start: Number, end: Number}} range with a timestamp for start and end * @returns {boolean} True if visible */ -Item.prototype.isVisible = function(range) { +Item.prototype.isVisible = function(range) { // eslint-disable-line no-unused-vars return false; }; @@ -244,9 +244,6 @@ Item.prototype._repaintOnItemUpdateTimeTooltip = function (anchor) { this.data.editable !== false; if (this.selected && editable && !this.dom.onItemUpdateTimeTooltip) { - // create and show tooltip - var me = this; - var onItemUpdateTimeTooltip = document.createElement('div'); onItemUpdateTimeTooltip.className = 'vis-onUpdateTime-tooltip'; @@ -321,6 +318,7 @@ Item.prototype._repaintOnItemUpdateTimeTooltip = function (anchor) { */ Item.prototype._updateContents = function (element) { var content; + var changed; var templateFunction; var itemVisibleFrameContent; var visibleFrameTemplateFunction; @@ -340,7 +338,7 @@ Item.prototype._updateContents = function (element) { if ((itemVisibleFrameContent instanceof Object) && !(itemVisibleFrameContent instanceof Element)) { visibleFrameTemplateFunction(itemData, itemVisibleFrameContentElement) } else { - var changed = this._contentToString(this.itemVisibleFrameContent) !== this._contentToString(itemVisibleFrameContent); + changed = this._contentToString(this.itemVisibleFrameContent) !== this._contentToString(itemVisibleFrameContent); if (changed) { // only replace the content when changed if (itemVisibleFrameContent instanceof Element) { @@ -371,7 +369,7 @@ Item.prototype._updateContents = function (element) { if ((content instanceof Object) && !(content instanceof Element)) { templateFunction(itemData, element) } else { - var changed = this._contentToString(this.content) !== this._contentToString(content); + changed = this._contentToString(this.content) !== this._contentToString(content); if (changed) { // only replace the content when changed if (content instanceof Element) { @@ -470,7 +468,7 @@ Item.prototype._updateEditStatus = function() { } else if(typeof this.options.editable === 'object') { this.editable = {}; util.selectiveExtend(['updateTime', 'updateGroup', 'remove'], this.editable, this.options.editable); - }; + } } // Item data overrides, except if options.editable.overrideItems is set. if (!this.options || !(this.options.editable) || (this.options.editable.overrideItems !== true)) { diff --git a/lib/timeline/component/item/RangeItem.js b/lib/timeline/component/item/RangeItem.js index 27dedd54e..485df4b57 100644 --- a/lib/timeline/component/item/RangeItem.js +++ b/lib/timeline/component/item/RangeItem.js @@ -1,4 +1,3 @@ -var Hammer = require('../../../module/hammer'); var Item = require('./Item'); /**