diff options
author | wout <wout@impinc.co.uk> | 2013-01-27 20:32:18 +0100 |
---|---|---|
committer | wout <wout@impinc.co.uk> | 2013-01-27 20:32:18 +0100 |
commit | f636268a12039ececaaec14ad1fd3d2671799297 (patch) | |
tree | 565d8064f772759ff7c331fa4fc480abe8c2253c /dist/svg.js | |
parent | b9981fd5c28d7282e6160ec7a32bcc3b103b9cf8 (diff) | |
download | svg.js-f636268a12039ececaaec14ad1fd3d2671799297.tar.gz svg.js-f636268a12039ececaaec14ad1fd3d2671799297.zip |
Simplifying data() method0.2
Diffstat (limited to 'dist/svg.js')
-rw-r--r-- | dist/svg.js | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/dist/svg.js b/dist/svg.js index 867792a..8caa1d4 100644 --- a/dist/svg.js +++ b/dist/svg.js @@ -1,4 +1,4 @@ -/* svg.js v0.1-89-gfe1747c - svg container element fx event group arrange defs mask pattern gradient doc shape wrap rect ellipse poly path image text nested sugar - svgjs.com/license */ +/* svg.js v0.1-90-gb9981fd - svg container element fx event group arrange defs mask pattern gradient doc shape wrap rect ellipse poly path image text nested sugar - svgjs.com/license */ (function() { this.svg = function(element) { @@ -358,8 +358,11 @@ // Store data values on svg nodes data: function(a, v) { if (arguments.length < 2) { - var value = this.attr('data-' + a); - try { return JSON.parse(value); } catch(e) { return value; }; + try { + return JSON.parse(this.attr('data-' + a)); + } catch(e) { + return this.attr('data-' + a); + }; } else { v === null ? |