summaryrefslogtreecommitdiffstats
path: root/src/container.js
diff options
context:
space:
mode:
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