Skip to content

Commit

Permalink
Added support for defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
thecountofzero committed Aug 1, 2012
1 parent 230563d commit e920434
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions observe/attributes/attributes.js
Expand Up @@ -201,6 +201,16 @@ can.each([ can.Observe, can.Model ], function(clss){
};
});

var oldSetup = can.Observe.prototype.setup;

can.Observe.prototype.setup = function(obj) {
oldSetup.call(this, obj);

this._init = 1;
this.attr(can.extend({}, this.constructor.defaults, this.attr()));
delete this._init;
};

/**
* @hide
* @function can.Observe.prototype.convert
Expand Down

0 comments on commit e920434

Please sign in to comment.