- return toret;
- },
- setMetaAttribute: function(key, value) {
- this.setAttr(key, value);
- },
- getOtherAttributes: function() {
- var toret = {},
- node = this;
- this.getAttrs().forEach(function(attr) {
- if(attr.name !== 'class' && !node.isMetaAttribute(attr.name)) {
- toret[attr.name] = {value: attr.value};
- }
- });
- return toret;
- },
- isMetaAttribute: function(attrName) {
- return attrName !== 'class' &&_.contains(_.keys(this.getMetaAttributes()), attrName);
- },
-
- getMetadata: function() {
- return this.getData(metadataKey) || [];
- },
-
- addMetadataRow: function(row) {
- this.setMetadataRow(null, row);
- },
-
- setMetadataRow: function(index, row) {
- var metadata = this.getData(metadataKey) || [];
- if(typeof index !== 'number' || index > metadata.length - 1) {
- metadata.push(row);
- index = metadata.length - 1;
- } else {
- metadata[index] = _.extend(metadata[index], row);
- }
- this.setData(metadataKey, metadata);
- this.triggerChangeEvent('metadataChange', {index: index});