refactored stage.reset method. Now storing node default attrs as an object which can be used by the stage to reset itself

This commit is contained in:
Eric Rowell
2012-05-26 18:40:43 -07:00
parent 44ba6f7e5b
commit af31e1ee83
4 changed files with 18 additions and 58 deletions

View File

@@ -9,7 +9,7 @@
* @param {Object} config
*/
Kinetic.Node = function(config) {
this.setDefaultAttrs({
this.defaultNodeAttrs = {
visible: true,
listening: true,
name: undefined,
@@ -28,8 +28,9 @@ Kinetic.Node = function(config) {
dragConstraint: 'none',
dragBounds: {},
draggable: false
});
};
this.setDefaultAttrs(this.defaultNodeAttrs);
this.eventListeners = {};
this.setAttrs(config);
};