|
|
@ -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) { |
|
|
|