diff options
author | wout <wout@impinc.co.uk> | 2013-01-04 19:12:16 +0100 |
---|---|---|
committer | wout <wout@impinc.co.uk> | 2013-01-04 19:12:16 +0100 |
commit | 2380c67d4ddded556617760b4b3cb38a1d7758e2 (patch) | |
tree | c0bd5ee57a4c83e5d8860becba7766188344eda3 /src/doc.js | |
parent | 40de19951d0a4218ee2625fa9a1a69f04e79692d (diff) | |
download | svg.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.js | 34 |
1 files changed, 17 insertions, 17 deletions
@@ -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 |