Sha256: 9c2c396727890e212d0983053fedb921520ef5d806a7f3e2e012fb14695a78e7

Contents?: true

Size: 828 Bytes

Versions: 4

Compression:

Stored size: 828 Bytes

Contents

var Button;
Button = (function() {
  function Button(node, path, options) {
    this.node = $(node);
    this.path = path;
    this.options = options || {};
    this.draw();
  }
  Button.prototype.draw = function() {
    var icon, paper;
    paper = Raphael(this.node.get(0));
    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,
      scale: this.options.scale || 0.85,
      translation: this.options.translation || ''
    });
    return this.node.hover(function() {
      return icon.animate({
        opacity: 1.0
      }, 200);
    }, function() {
      return icon.animate({
        opacity: 0.6
      }, 200);
    });
  };
  return Button;
})();

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
vines-0.3.2 web/lib/javascripts/button.js
vines-0.3.1 web/lib/javascripts/button.js
vines-0.3.0 web/lib/javascripts/button.js
vines-0.2.1 web/lib/javascripts/button.js