new getAttrs() method

This commit is contained in:
Eric Rowell
2012-04-07 18:50:53 -07:00
parent 0a94c75e22
commit d3b025254a
5 changed files with 69 additions and 11 deletions

16
dist/kinetic-core.js vendored
View File

@@ -284,6 +284,12 @@ Kinetic.Node.prototype = {
}
}
},
/**
* get attrs
*/
getAttrs: function() {
return this.attrs;
},
/**
* show node
*/
@@ -1113,7 +1119,7 @@ Kinetic.Stage.prototype = {
addLayer(0);
},
/**
* serialize stage and children as JSON object
* serialize stage and children as a JSON object
*/
toJSON: function() {
var go = Kinetic.GlobalObject;
@@ -1140,7 +1146,13 @@ Kinetic.Stage.prototype = {
return JSON.stringify(addNode(this));
},
/**
* load stage with JSON string
* load stage with JSON string. De-serializtion does not generate custom
* shape drawing functions, images, or event handlers (this would make the
* serialized object huge). If your app uses custom shapes, images, and
* event handlers (it probably does), then you need to select the appropriate
* shapes after loading the stage and set these properties via on(), setDrawFunc(),
* and setImage()
* @param {String} JSON string
*/
load: function(json) {
function loadNode(node, obj) {

File diff suppressed because one or more lines are too long