Created
March 19, 2014 08:58
-
-
Save pixelhijack/9637971 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
export whole canvas as JSON via RaphaelJSON | |
*/ | |
exportJSON:function(){ | |
var _this = this, | |
json = this.paper.toJSON(function(el, data){ | |
data.ft = {}; | |
if ( el.freeTransform != null ){ | |
data.ft.attrs = el.freeTransform.attrs; | |
_this.paper.freeTransform(el).unplug(); | |
}; | |
return data; | |
}); | |
if(this.output && typeof this.output == 'function'){ | |
this.output.call(this, json); | |
}; | |
} | |
/* ... */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment