Skip to content
This repository has been archived by the owner on Jul 29, 2019. It is now read-only.

lint timeline component item #3310

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions lib/timeline/component/item/BackgroundItem.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
var Hammer = require('../../../module/hammer');
var Item = require('./Item');
var BackgroundGroup = require('../BackgroundGroup');
var RangeItem = require('./RangeItem');
Expand Down Expand Up @@ -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';

Expand Down
1 change: 0 additions & 1 deletion lib/timeline/component/item/BoxItem.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
var Item = require('./Item');
var util = require('../../../util');

/**
* @constructor BoxItem
Expand Down
12 changes: 5 additions & 7 deletions lib/timeline/component/item/Item.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};

Expand Down Expand Up @@ -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';
Expand Down Expand Up @@ -321,6 +318,7 @@ Item.prototype._repaintOnItemUpdateTimeTooltip = function (anchor) {
*/
Item.prototype._updateContents = function (element) {
var content;
var changed;
var templateFunction;
var itemVisibleFrameContent;
var visibleFrameTemplateFunction;
Expand All @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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)) {
Expand Down
1 change: 0 additions & 1 deletion lib/timeline/component/item/RangeItem.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
var Hammer = require('../../../module/hammer');
var Item = require('./Item');

/**
Expand Down