aboutsummaryrefslogtreecommitdiffstats
path: root/src/group.js
diff options
context:
space:
mode:
authorwout <wout@impinc.co.uk>2012-12-17 16:55:16 +0100
committerwout <wout@impinc.co.uk>2012-12-17 16:55:16 +0100
commit6a013f19d6fa84e538d31bca5f1466c5f3479630 (patch)
tree3807acc4240bb1dbd5f25406b262a240351fa67a /src/group.js
parent9ba8a780e0da4de4839df119f1d57d7f6327b1c6 (diff)
downloadsvg.js-6a013f19d6fa84e538d31bca5f1466c5f3479630.tar.gz
svg.js-6a013f19d6fa84e538d31bca5f1466c5f3479630.zip
Refactored code for readability and size
Diffstat (limited to 'src/group.js')
-rw-r--r--src/group.js21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/group.js b/src/group.js
index e46035f..2236c09 100644
--- a/src/group.js
+++ b/src/group.js
@@ -1,16 +1,21 @@
SVG.Group = function Group() {
- this.constructor.call(this, SVG.createElement("g"));
+ this.constructor.call(this, SVG.create('g'));
};
// inherit from SVG.Element
SVG.Group.prototype = new SVG.Element();
-// group rotation
-SVG.Group.prototype.rotate = function(d) {
- this.setAttribute('transform', 'rotate(' + d + ')');
- return this;
-};
-
// include the container object
-SVG.Group.include(SVG.Container); \ No newline at end of file
+SVG.Utils.merge(SVG.Group, SVG.Container);
+
+// Add group-specific functions
+SVG.Utils.merge(SVG.Group, {
+
+ // group rotation
+ rotate: function(d) {
+ this.attr('transform', 'rotate(' + d + ')');
+ return this;
+ }
+
+}); \ No newline at end of file