From: gschutz Date: Mon, 5 Jan 2015 17:39:11 +0000 (-0200) Subject: fix #306 - The use element now can point to an external file X-Git-Tag: 1.1.0~6^2~2^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=45fe9c7a5a5f9fea774960ecefe32ab1ddf6ae24;p=svg.js.git fix #306 - The use element now can point to an external file --- diff --git a/src/use.js b/src/use.js index 2690468..9bea70c 100755 --- a/src/use.js +++ b/src/use.js @@ -8,20 +8,20 @@ SVG.Use = SVG.invent({ // Add class methods , extend: { // Use element as a reference - element: function(element) { + element: function(element, file) { /* store target element */ this.target = element /* set lined element */ - return this.attr('href', '#' + element, SVG.xlink) + return this.attr('href', (file || '') + '#' + element, SVG.xlink) } } // Add parent method , construct: { // Create a use element - use: function(element) { - return this.put(new SVG.Use).element(element) + use: function(element, file) { + return this.put(new SVG.Use).element(element, file) } } }) \ No newline at end of file