Browse Source

Commit before pull

codeClimate
Yotam Berkowitz 8 years ago
parent
commit
2f2f5c4cc8
2 changed files with 5 additions and 2 deletions
  1. +1
    -0
      lib/timeline/Timeline.js
  2. +4
    -2
      lib/timeline/component/item/Item.js

+ 1
- 0
lib/timeline/Timeline.js View File

@ -111,6 +111,7 @@ function Timeline (container, items, groups, options) {
} }
// item set // item set
console.log("aaaaaaaaaa", this.options, options);
this.itemSet = new ItemSet(this.body, this.options); this.itemSet = new ItemSet(this.body, this.options);
this.components.push(this.itemSet); this.components.push(this.itemSet);

+ 4
- 2
lib/timeline/component/item/Item.js View File

@ -188,7 +188,7 @@ Item.prototype._repaintDeleteButton = function (anchor) {
Item.prototype._updateContents = function (element) { Item.prototype._updateContents = function (element) {
var content; var content;
var templateFunction; var templateFunction;
console.log(this.options);
if (this.options.template) { if (this.options.template) {
var itemData = this.parent.itemSet.itemsData.get(this.id); // get a clone of the data from the dataset var itemData = this.parent.itemSet.itemsData.get(this.id); // get a clone of the data from the dataset
templateFunction = this.options.template.bind(this); templateFunction = this.options.template.bind(this);
@ -197,7 +197,9 @@ Item.prototype._updateContents = function (element) {
content = this.data.content; content = this.data.content;
} }
if (content instanceof Object) {
console.log(content);
console.log("content: " , content, content instanceof Object, !(content instanceof Element));
if ((content instanceof Object) && !(content instanceof Element)) {
templateFunction(itemData, element) templateFunction(itemData, element)
} else { } else {
var changed = this._contentToString(this.content) !== this._contentToString(content); var changed = this._contentToString(this.content) !== this._contentToString(content);

Loading…
Cancel
Save