ChangeProperty: smartxmlTransformations.createContextTransformation({
impl: function(t, rowIndex, propName, value) {
var row = this.getMetadata().at(rowIndex);
+ if(row.getValue() === value) {
+ return;
+ }
t.rowIndex = rowIndex;
t.propName = propName;
t.oldValue = row[propName];
this.triggerChangeEvent('metadataRemoved', {row: t.row});
},
undo: function(t) {
- var metadata = this.getMetadata();
- metadata._rows.splice(t.rowIdx, 0, new Row(t.row.getKey(), t.row.getValue(), metadata));
+ var metadata = this.getMetadata(),
+ row = new Row(t.row.getKey(), t.row.getValue(), metadata);
+ metadata._rows.splice(t.rowIdx, 0, row);
+ this.triggerChangeEvent('metadataAdded', {row: row});
}
}),