summaryrefslogtreecommitdiffstats
path: root/src/doc.js
diff options
context:
space:
mode:
authorwout <wout@impinc.co.uk>2013-01-04 19:12:16 +0100
committerwout <wout@impinc.co.uk>2013-01-04 19:12:16 +0100
commit2380c67d4ddded556617760b4b3cb38a1d7758e2 (patch)
treec0bd5ee57a4c83e5d8860becba7766188344eda3 /src/doc.js
parent40de19951d0a4218ee2625fa9a1a69f04e79692d (diff)
downloadsvg.js-2380c67d4ddded556617760b4b3cb38a1d7758e2.tar.gz
svg.js-2380c67d4ddded556617760b4b3cb38a1d7758e2.zip
Made code more readable and included docs
Diffstat (limited to 'src/doc.js')
-rw-r--r--src/doc.js34
1 files changed, 17 insertions, 17 deletions
diff --git a/src/doc.js b/src/doc.js
index 3d563a3..0785579 100644
--- a/src/doc.js
+++ b/src/doc.js
@@ -1,33 +1,33 @@
+// ### This module accounts for the main svg document
-SVG.Doc = function Doc(e) {
+//
+SVG.Doc = function Doc(element) {
this.constructor.call(this, SVG.create('svg'));
- // create extra wrapper
- var w = document.createElement('div');
- w.style.cssText = 'position:relative;width:100%;height:100%;';
+ /* create an extra wrapper */
+ var wrapper = document.createElement('div');
+ wrapper.style.cssText = 'position:relative;width:100%;height:100%;';
- // ensure the presence of a html element
- if (typeof e == 'string')
- e = document.getElementById(e);
+ /* ensure the presence of a html element */
+ if (typeof element == 'string')
+ element = document.getElementById(element);
- // set svg element attributes
+ /* set svg element attributes and create the <defs> node */
this.
attr({ xmlns: SVG.ns, version: '1.1', width: '100%', height: '100%' }).
attr('xlink', SVG.xlink, SVG.ns).
defs();
- // add elements
- e.appendChild(w);
- w.appendChild(this.node);
+ /* add elements */
+ element.appendChild(wrapper);
+ wrapper.appendChild(this.node);
- // ensure correct rendering for safari
+ /* ensure correct rendering for safari */
this.stage();
};
-// inherit from SVG.Element
+// Inherits from SVG.Element
SVG.Doc.prototype = new SVG.Element();
-// include the container object
-SVG.extend(SVG.Doc, SVG.Container);
-
-
+// Include the container object
+SVG.extend(SVG.Doc, SVG.Container); \ No newline at end of file