diff --git a/lib/timeline/component/item/Item.js b/lib/timeline/component/item/Item.js index dfb9abb3..598d19d4 100644 --- a/lib/timeline/component/item/Item.js +++ b/lib/timeline/component/item/Item.js @@ -201,8 +201,20 @@ Item.prototype._updateTitle = function (element) { */ Item.prototype._updateDataAttributes = function(element) { if (this.options.dataAttributes && this.options.dataAttributes.length > 0) { - for (var i = 0; i < this.options.dataAttributes.length; i++) { - var name = this.options.dataAttributes[i]; + var attributes = []; + + if (Array.isArray(this.options.dataAttributes)) { + attributes = this.options.dataAttributes; + } + else if (this.options.dataAttributes == 'all') { + attributes = Object.keys(this.data); + } + else { + return; + } + + for (var i = 0; i < attributes.length; i++) { + var name = attributes[i]; var value = this.data[name]; if (value != null) {