Sha256: dc727634828dd02dc1dcc21f5c37776ffc4c500f017323fac9b023d45b5b8309

Contents?: true

Size: 1.2 KB

Versions: 6

Compression:

Stored size: 1.2 KB

Contents

/**
 * 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();
};

Version data entries

6 entries across 6 versions & 3 rubygems

Version Path
jinda_lte-0.0.1 lib/generators/jinda_lte/templates/app/assets/jinda_assets/bower_components/jvectormap/src/svg-element.js
jvectormap-rails-2.0.0 vendor/assets/javascripts/jvectormap/src/svg-element.js
jvectormap-rails-1.0.1 vendor/assets/javascripts/jvectormap/lib/svg-element.js
jvectormap-rails4-1.0.1 vendor/assets/javascripts/jvectormap/lib/svg-element.js
jvectormap-rails4-1.0.0 vendor/assets/javascripts/jvectormap/lib/svg-element.js
jvectormap-rails-1.0.0 vendor/assets/javascripts/jvectormap/lib/svg-element.js