diff options
Diffstat (limited to 'public/bower_components/jvectormap/src/svg-element.js')
-rw-r--r-- | public/bower_components/jvectormap/src/svg-element.js | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/public/bower_components/jvectormap/src/svg-element.js b/public/bower_components/jvectormap/src/svg-element.js new file mode 100644 index 0000000..00b2d90 --- /dev/null +++ b/public/bower_components/jvectormap/src/svg-element.js @@ -0,0 +1,48 @@ +/** + * Wrapper for SVG element. + * @constructor + * @extends jvm.AbstractElement + * @param {String} name Tag name of the element + * @param {Object} config Set of parameters to initialize element with + */ + +jvm.SVGElement = function(name, config){ + jvm.SVGElement.parentClass.apply(this, arguments); +} + +jvm.inherits(jvm.SVGElement, jvm.AbstractElement); + +jvm.SVGElement.svgns = "http://www.w3.org/2000/svg"; + +/** + * Creates DOM element. + * @param {String} tagName Name of element + * @private + * @returns DOMElement + */ +jvm.SVGElement.prototype.createElement = function( tagName ){ + return document.createElementNS( jvm.SVGElement.svgns, tagName ); +}; + +/** + * Adds CSS class for underlying DOM element. + * @param {String} className Name of CSS class name + */ +jvm.SVGElement.prototype.addClass = function( className ){ + this.node.setAttribute('class', className); +}; + +/** + * Returns constructor for element by name prefixed with 'VML'. + * @param {String} ctr Name of basic constructor to return + * proper implementation for. + * @returns Function + * @private + */ +jvm.SVGElement.prototype.getElementCtr = function( ctr ){ + return jvm['SVG'+ctr]; +}; + +jvm.SVGElement.prototype.getBBox = function(){ + return this.node.getBBox(); +};
\ No newline at end of file |