Sha256: d332aeed10c26ce0c498a1b6c1fd7707d0b32381f8e173352770b581acf99638

Contents?: true

Size: 1.42 KB

Versions: 6

Compression:

Stored size: 1.42 KB

Contents

jvm.VMLShapeElement = function(name, config){
  jvm.VMLShapeElement.parentClass.call(this, name, config);

  this.fillElement = new jvm.VMLElement('fill');
  this.strokeElement = new jvm.VMLElement('stroke');
  this.node.appendChild(this.fillElement.node);
  this.node.appendChild(this.strokeElement.node);
  this.node.stroked = false;

  jvm.AbstractShapeElement.apply(this, arguments);
};

jvm.inherits(jvm.VMLShapeElement, jvm.VMLElement);
jvm.mixin(jvm.VMLShapeElement, jvm.AbstractShapeElement);

jvm.VMLShapeElement.prototype.applyAttr = function(attr, value){
  switch (attr) {
    case 'fill':
      this.node.fillcolor = value;
      break;
    case 'fill-opacity':
      this.fillElement.node.opacity = Math.round(value*100)+'%';
      break;
    case 'stroke':
      if (value === 'none') {
        this.node.stroked = false;
      } else {
        this.node.stroked = true;
      }
      this.node.strokecolor = value;
      break;
    case 'stroke-opacity':
      this.strokeElement.node.opacity = Math.round(value*100)+'%';
      break;
    case 'stroke-width':
      if (parseInt(value, 10) === 0) {
        this.node.stroked = false;
      } else {
        this.node.stroked = true;
      }
      this.node.strokeweight = value;
      break;
    case 'd':
      this.node.path = jvm.VMLPathElement.pathSvgToVml(value);
      break;
    default:
      jvm.VMLShapeElement.parentClass.prototype.applyAttr.apply(this, arguments);
  }
};

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/vml-shape-element.js
jvectormap-rails-2.0.0 vendor/assets/javascripts/jvectormap/src/vml-shape-element.js
jvectormap-rails-1.0.1 vendor/assets/javascripts/jvectormap/lib/vml-shape-element.js
jvectormap-rails4-1.0.1 vendor/assets/javascripts/jvectormap/lib/vml-shape-element.js
jvectormap-rails4-1.0.0 vendor/assets/javascripts/jvectormap/lib/vml-shape-element.js
jvectormap-rails-1.0.0 vendor/assets/javascripts/jvectormap/lib/vml-shape-element.js