diff options
author | Marvin Borner | 2018-07-13 19:06:45 +0200 |
---|---|---|
committer | Marvin Borner | 2018-07-13 19:06:45 +0200 |
commit | 6fcfb7c04d32e1c8b26a312295bf7ac3ec2d2ad7 (patch) | |
tree | dbc87ef16fa01d5d99116de283592b8fe5e02944 /public/bower_components/jvectormap/src/vml-shape-element.js | |
parent | dfd839f27146df0ad0494e11734fc7d310c70ebf (diff) |
Fixed many permissions and began admin interface
Diffstat (limited to 'public/bower_components/jvectormap/src/vml-shape-element.js')
-rw-r--r-- | public/bower_components/jvectormap/src/vml-shape-element.js | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/public/bower_components/jvectormap/src/vml-shape-element.js b/public/bower_components/jvectormap/src/vml-shape-element.js new file mode 100644 index 0000000..85e9791 --- /dev/null +++ b/public/bower_components/jvectormap/src/vml-shape-element.js @@ -0,0 +1,49 @@ +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); + } +};
\ No newline at end of file |