Before this change calling Node.setAttr(undefined) was a noop.
setAttr: function(name, value, silent) {
var oldVal = this.getAttr(name);
setAttr: function(name, value, silent) {
var oldVal = this.getAttr(name);
- this._$.attr(name, value);
+ if(_.isUndefined(value)) {
+ this._$.removeAttr(name);
+ } else {
+ this._$.attr(name, value);
+ }
if(!silent) {
this.triggerChangeEvent('nodeAttrChange', {attr: name, oldVal: oldVal, newVal: value});
}
if(!silent) {
this.triggerChangeEvent('nodeAttrChange', {attr: name, oldVal: oldVal, newVal: value});
}