diff options
Diffstat (limited to 'src/use.js')
-rw-r--r-- | src/use.js | 21 |
1 files changed, 11 insertions, 10 deletions
@@ -1,24 +1,25 @@ + SVG.Use = SVG.invent({ // Initialize node - create: 'use' + create: 'use', // Inherit from -, inherit: SVG.Shape + inherit: SVG.Shape, // Add class methods -, extend: { + extend: { // Use element as a reference - element: function(element, file) { - // Set lined element + element: function (element, file) { + // Set lined element return this.attr('href', (file || '') + '#' + element, SVG.xlink) } - } - + }, + // Add parent method -, construct: { + construct: { // Create a use element - use: function(element, file) { - return this.put(new SVG.Use).element(element, file) + use: function (element, file) { + return this.put(new SVG.Use()).element(element, file) } } }) |