diff options
author | wout <wout@impinc.co.uk> | 2012-12-21 19:58:49 +0100 |
---|---|---|
committer | wout <wout@impinc.co.uk> | 2012-12-21 19:58:49 +0100 |
commit | 9dd851e68a3241883dea7236da48d4878b1b1899 (patch) | |
tree | 0da2a3ab4c8fab04228967f354e99f4a3027fad7 /src/doc.js | |
parent | 34a2a1ad00c96f3ef222a08ff5516b2067f7af87 (diff) | |
download | svg.js-9dd851e68a3241883dea7236da48d4878b1b1899.tar.gz svg.js-9dd851e68a3241883dea7236da48d4878b1b1899.zip |
Cross browser fixes
Diffstat (limited to 'src/doc.js')
-rw-r--r-- | src/doc.js | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -2,15 +2,17 @@ SVG.Doc = function Doc(e) { this.constructor.call(this, SVG.create('svg')); + // ensure the presence of a html element + if (typeof e == 'string') + e = document.getElementById(e); + // set this. attr({ xmlns: SVG.ns, version: '1.1' }). attr('xlink', SVG.xlink, SVG.ns). + size(e.offsetWidth, e.offsetHeight). defs(); - if (typeof e == 'string') - e = document.getElementById(e); - e.appendChild(this.node); }; |