Browse Source

Removed parameter `parent` from Item constructor

css_transitions
jos 10 years ago
parent
commit
36e512cefb
6 changed files with 19 additions and 20 deletions
  1. +5
    -1
      src/timeline/component/ItemSet.js
  2. +2
    -3
      src/timeline/component/item/Item.js
  3. +3
    -4
      src/timeline/component/item/ItemBox.js
  4. +3
    -4
      src/timeline/component/item/ItemPoint.js
  5. +3
    -4
      src/timeline/component/item/ItemRange.js
  6. +3
    -4
      src/timeline/component/item/ItemRangeOverflow.js

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

@ -76,6 +76,7 @@ function ItemSet(backgroundPanel, axisPanel, labelPanel, options) {
this.touchParams = {}; // stores properties while dragging
// create the HTML DOM
this._create();
}
@ -115,6 +116,9 @@ ItemSet.prototype._create = function _create(){
this.dom.axis = axis;
this.axisPanel.frame.appendChild(axis);
// create ungrouped Group
this._updateUngrouped();
// attach event listeners
// TODO: use event listeners from the rootpanel to improve performance?
this.hammer = Hammer(frame, {
@ -735,7 +739,7 @@ ItemSet.prototype._onUpdate = function _onUpdate(ids) {
if (!item) {
// create item
if (constructor) {
item = new constructor(me, itemData, me.options, itemOptions);
item = new constructor(itemData, me.options, itemOptions);
item.id = id; // TODO: not so nice setting id afterwards
me._addItem(item);
}

+ 2
- 3
src/timeline/component/item/Item.js View File

@ -1,15 +1,14 @@
/**
* @constructor Item
* @param {ItemSet | Group} parent
* @param {Object} data Object containing (optional) parameters type,
* start, end, content, group, className.
* @param {Object} [options] Options to set initial property values
* @param {Object} [defaultOptions] default options
* // TODO: describe available options
*/
function Item (parent, data, options, defaultOptions) {
function Item (data, options, defaultOptions) {
this.id = null;
this.parent = parent;
this.parent = null;
this.data = data;
this.dom = null;
this.options = options || {};

+ 3
- 4
src/timeline/component/item/ItemBox.js View File

@ -1,14 +1,13 @@
/**
* @constructor ItemBox
* @extends Item
* @param {ItemSet} parent
* @param {Object} data Object containing parameters start
* content, className.
* @param {Object} [options] Options to set initial property values
* @param {Object} [defaultOptions] default options
* // TODO: describe available options
*/
function ItemBox (parent, data, options, defaultOptions) {
function ItemBox (data, options, defaultOptions) {
this.props = {
dot: {
width: 0,
@ -27,10 +26,10 @@ function ItemBox (parent, data, options, defaultOptions) {
}
}
Item.call(this, parent, data, options, defaultOptions);
Item.call(this, data, options, defaultOptions);
}
ItemBox.prototype = new Item (null, null);
ItemBox.prototype = new Item (null);
/**
* Check whether this item is visible inside given range

+ 3
- 4
src/timeline/component/item/ItemPoint.js View File

@ -1,14 +1,13 @@
/**
* @constructor ItemPoint
* @extends Item
* @param {ItemSet} parent
* @param {Object} data Object containing parameters start
* content, className.
* @param {Object} [options] Options to set initial property values
* @param {Object} [defaultOptions] default options
* // TODO: describe available options
*/
function ItemPoint (parent, data, options, defaultOptions) {
function ItemPoint (data, options, defaultOptions) {
this.props = {
dot: {
top: 0,
@ -28,10 +27,10 @@ function ItemPoint (parent, data, options, defaultOptions) {
}
}
Item.call(this, parent, data, options, defaultOptions);
Item.call(this, data, options, defaultOptions);
}
ItemPoint.prototype = new Item (null, null);
ItemPoint.prototype = new Item (null);
/**
* Check whether this item is visible inside given range

+ 3
- 4
src/timeline/component/item/ItemRange.js View File

@ -1,14 +1,13 @@
/**
* @constructor ItemRange
* @extends Item
* @param {ItemSet} parent
* @param {Object} data Object containing parameters start, end
* content, className.
* @param {Object} [options] Options to set initial property values
* @param {Object} [defaultOptions] default options
* // TODO: describe available options
*/
function ItemRange (parent, data, options, defaultOptions) {
function ItemRange (data, options, defaultOptions) {
this.props = {
content: {
width: 0
@ -25,10 +24,10 @@ function ItemRange (parent, data, options, defaultOptions) {
}
}
Item.call(this, parent, data, options, defaultOptions);
Item.call(this, data, options, defaultOptions);
}
ItemRange.prototype = new Item (null, null);
ItemRange.prototype = new Item (null);
ItemRange.prototype.baseClassName = 'item range';

+ 3
- 4
src/timeline/component/item/ItemRangeOverflow.js View File

@ -1,14 +1,13 @@
/**
* @constructor ItemRangeOverflow
* @extends ItemRange
* @param {ItemSet} parent
* @param {Object} data Object containing parameters start, end
* content, className.
* @param {Object} [options] Options to set initial property values
* @param {Object} [defaultOptions] default options
* // TODO: describe available options
*/
function ItemRangeOverflow (parent, data, options, defaultOptions) {
function ItemRangeOverflow (data, options, defaultOptions) {
this.props = {
content: {
left: 0,
@ -16,10 +15,10 @@ function ItemRangeOverflow (parent, data, options, defaultOptions) {
}
};
ItemRange.call(this, parent, data, options, defaultOptions);
ItemRange.call(this, data, options, defaultOptions);
}
ItemRangeOverflow.prototype = new ItemRange (null, null);
ItemRangeOverflow.prototype = new ItemRange (null);
ItemRangeOverflow.prototype.baseClassName = 'item rangeoverflow';

Loading…
Cancel
Save