diff options
author | gschutz <guilherme@gschutz.com> | 2015-01-05 15:39:34 -0200 |
---|---|---|
committer | gschutz <guilherme@gschutz.com> | 2015-01-05 15:39:34 -0200 |
commit | 90c50d94b0def16af6bc43fa62325279e50cf7b5 (patch) | |
tree | 061cb77fabee176e9aac98f51eac37f40c85cc93 | |
parent | 7984a87786effaed2ed6e517c899cc68204e4e6b (diff) | |
parent | 45fe9c7a5a5f9fea774960ecefe32ab1ddf6ae24 (diff) | |
download | svg.js-90c50d94b0def16af6bc43fa62325279e50cf7b5.tar.gz svg.js-90c50d94b0def16af6bc43fa62325279e50cf7b5.zip |
Finish use-element
-rwxr-xr-x | src/use.js | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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 |