aboutsummaryrefslogtreecommitdiffstats
path: root/dist/svg.js
diff options
context:
space:
mode:
authorwout <wout@impinc.co.uk>2012-12-21 19:58:49 +0100
committerwout <wout@impinc.co.uk>2012-12-21 19:58:49 +0100
commit9dd851e68a3241883dea7236da48d4878b1b1899 (patch)
tree0da2a3ab4c8fab04228967f354e99f4a3027fad7 /dist/svg.js
parent34a2a1ad00c96f3ef222a08ff5516b2067f7af87 (diff)
downloadsvg.js-9dd851e68a3241883dea7236da48d4878b1b1899.tar.gz
svg.js-9dd851e68a3241883dea7236da48d4878b1b1899.zip
Cross browser fixes
Diffstat (limited to 'dist/svg.js')
-rw-r--r--dist/svg.js30
1 files changed, 16 insertions, 14 deletions
diff --git a/dist/svg.js b/dist/svg.js
index 32315d9..82d55eb 100644
--- a/dist/svg.js
+++ b/dist/svg.js
@@ -1,4 +1,4 @@
-/* svg.js 0.1a - svg container element group arrange defs clip doc shape rect circle ellipse path image text sugar - svgjs.com/license */
+/* svg.js v0.1 - svg container element group arrange defs clip doc shape rect circle ellipse path image text sugar - svgjs.com/license */
(function() {
this.SVG = {
@@ -199,15 +199,6 @@
else
return this.attrs[a];
- } else if (this._isStyle(a)) {
- a == 'text' ?
- this.text(v) :
- a == 'leading' ?
- this[a] = v :
- this.style[a] = v;
-
- this.text(this.content);
-
} else {
this.attrs[a] = v;
if (a == 'x' && this._isText())
@@ -217,7 +208,16 @@
n != null ?
this.node.setAttributeNS(n, a, v) :
this.node.setAttribute(a, v);
-
+
+ if (this._isStyle(a)) {
+ a == 'text' ?
+ this.text(v) :
+ a == 'leading' ?
+ this[a] = v :
+ this.style[a] = v;
+
+ this.text(this.content);
+ }
}
return this;
@@ -394,15 +394,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);
};