aboutsummaryrefslogtreecommitdiffstats
path: root/src/container.js
diff options
context:
space:
mode:
authorwout <wout@impinc.co.uk>2014-02-03 15:14:47 +0100
committerwout <wout@impinc.co.uk>2014-02-03 15:14:47 +0100
commite2304534e0cfb6f6f4ab8c37ea5275ae26cd455a (patch)
tree2386e9f361d9c5fa1308387aeeaf33f00241b3c5 /src/container.js
parent7a29817ffd764cf7ab6906250b57f234801c94e0 (diff)
downloadsvg.js-e2304534e0cfb6f6f4ab8c37ea5275ae26cd455a.tar.gz
svg.js-e2304534e0cfb6f6f4ab8c37ea5275ae26cd455a.zip
Implemented SVG.invent function and bumped to v1.0rc3
Diffstat (limited to 'src/container.js')
-rwxr-xr-xsrc/container.js41
1 files changed, 22 insertions, 19 deletions
diff --git a/src/container.js b/src/container.js
index 60f62c4..e63f2ae 100755
--- a/src/container.js
+++ b/src/container.js
@@ -1,24 +1,27 @@
-SVG.Container = function(element) {
- this.constructor.call(this, element)
-}
+SVG.Container = SVG.invent({
+ // Initialize node
+ create: function(element) {
+ this.constructor.call(this, element)
+ }
-// Inherit from SVG.Parent
-SVG.Container.prototype = new SVG.Parent
+ // Inherit from
+, inherit: SVG.Parent
-//
-SVG.extend(SVG.Container, {
- // Get the viewBox and calculate the zoom value
- viewbox: function(v) {
- if (arguments.length == 0)
- /* act as a getter if there are no arguments */
- return new SVG.ViewBox(this)
-
- /* otherwise act as a setter */
- v = arguments.length == 1 ?
- [v.x, v.y, v.width, v.height] :
- [].slice.call(arguments)
-
- return this.attr('viewBox', v)
+ // Add class methods
+, extend: {
+ // Get the viewBox and calculate the zoom value
+ viewbox: function(v) {
+ if (arguments.length == 0)
+ /* act as a getter if there are no arguments */
+ return new SVG.ViewBox(this)
+
+ /* otherwise act as a setter */
+ v = arguments.length == 1 ?
+ [v.x, v.y, v.width, v.height] :
+ [].slice.call(arguments)
+
+ return this.attr('viewBox', v)
+ }
}
}) \ No newline at end of file