var Button; Button = (function() { function Button(node, path, options) { this.node = $(node); this.path = path; this.options = options || {}; if (this.options.animate == null) { this.options.animate = true; } this.draw(); } Button.prototype.draw = function() { var icon, paper, transform; paper = Raphael(this.node.get(0)); transform = "s" + (this.options.scale || 0.85); if (this.options.translation) { transform += ",t" + this.options.translation; } icon = paper.path(this.path).attr({ fill: this.options.fill || '#000', stroke: this.options.stroke || '#fff', 'stroke-width': this.options['stroke-width'] || 0.3, opacity: this.options.opacity || 0.6, transform: transform }); if (this.options.animate) { return this.node.hover(function() { return icon.animate({ opacity: 1.0 }, 200); }, function() { return icon.animate({ opacity: 0.6 }, 200); }); } }; return Button; })();