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/image.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/image.js')
-rw-r--r-- | src/image.js | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/image.js b/src/image.js index 8ae8ef3..b9340e4 100644 --- a/src/image.js +++ b/src/image.js @@ -1,18 +1,16 @@ - SVG.Image = function Image() { this.constructor.call(this, SVG.create('image')); }; -// inherit from SVG.Element +// Inherit from SVG.Element SVG.Image.prototype = new SVG.Shape(); -// add image-specific functions SVG.extend(SVG.Image, { - // (re)load image - load: function(u) { - this.src = u; - return (u ? this.attr('xlink:href', u, SVG.xlink) : this); + /* (re)load image */ + load: function(url) { + this.src = url; + return (url ? this.attr('xlink:href', url, SVG.xlink) : this); } });
\ No newline at end of file |