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-image-element.js | |
parent | dfd839f27146df0ad0494e11734fc7d310c70ebf (diff) |
Fixed many permissions and began admin interface
Diffstat (limited to 'public/bower_components/jvectormap/src/vml-image-element.js')
-rw-r--r-- | public/bower_components/jvectormap/src/vml-image-element.js | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/public/bower_components/jvectormap/src/vml-image-element.js b/public/bower_components/jvectormap/src/vml-image-element.js new file mode 100644 index 0000000..8fb7ca9 --- /dev/null +++ b/public/bower_components/jvectormap/src/vml-image-element.js @@ -0,0 +1,47 @@ +jvm.VMLImageElement = function(config, style){ + jvm.VMLImageElement.parentClass.call(this, 'image', config, style); +}; + +jvm.inherits(jvm.VMLImageElement, jvm.VMLShapeElement); + +jvm.VMLImageElement.prototype.applyAttr = function(attr, value){ + var patternEl, + imageEl, + that = this; + + if (attr == 'image') { + jvm.whenImageLoaded(value).then(function(img){ + that.node.setAttribute('src', value); + that.width = img[0].width; + that.height = img[0].height; + that.applyAttr('width', that.width); + that.applyAttr('height', that.height); + + jvm.VMLImageElement.images[value] = jvm.VMLImageElement.imageCounter++; + + that.applyAttr('x', that.cx - that.width / 2); + that.applyAttr('y', that.cy - that.height / 2); + + jvm.$(that.node).trigger('imageloaded', [img]); + }); + } else if(attr == 'cx') { + this.cx = value; + if (this.width) { + this.applyAttr('x', value - this.width / 2); + } + } else if(attr == 'cy') { + this.cy = value; + if (this.height) { + this.applyAttr('y', value - this.height / 2); + } + } else if(attr == 'width' || attr == 'height') { + this.node.style[attr] = value + 'px'; + } else if (attr == 'x' || attr == 'y') { + this.node.style[attr == 'x' ? 'left' : 'top'] = value + 'px'; + } else { + jvm.VMLImageElement.parentClass.prototype.applyAttr.apply(this, arguments); + } +}; + +jvm.VMLImageElement.imageCounter = 1; +jvm.VMLImageElement.images = {}
\ No newline at end of file |