old_contents: // ==========================================================================
  // Project:   SproutCore Handlebar Views
  // Copyright: ©2011 Strobe Inc. and contributors.
  // License:   Licensed under MIT license (see license.js)
  // ==========================================================================
  
  require('sproutcore-runtime/mixins/target_action_support');
  
  var get = SC.get, set = SC.set;
  
  SC.Button = SC.View.extend(SC.TargetActionSupport, {
    classNames: ['sc-button'],
    classNameBindings: ['isActive'],
  
    tagName: 'button',
    attributeBindings: ['type', 'disabled'],
    type: 'button',
    disabled: false,
    propagateEvents: false,
  
    mouseDown: function() {
      set(this, 'isActive', true);
      this._mouseDown = true;
      this._mouseEntered = true;
      return this.get('propagateEvents');
    },
  
    mouseLeave: function() {
      if (this._mouseDown) {
        set(this, 'isActive', false);
        this._mouseEntered = false;
      }
    },
  
    mouseEnter: function() {
      if (this._mouseDown) {
        set(this, 'isActive', true);
        this._mouseEntered = true;
      }
    },
  
    mouseUp: function(event) {
      if (get(this, 'isActive')) {
  
        // Actually invoke the button's target and action.
        // This method comes from the SC.TargetActionSupport mixin.
        this.triggerAction();
        set(this, 'isActive', false);
      }
  
      this._mouseDown = false;
      this._mouseEntered = false;
      return this.get('propagateEvents');
    },
  
    // TODO: Handle proper touch behavior.  Including should make inactive when
    // finger moves more than 20x outside of the edge of the button (vs mouse
    // which goes inactive as soon as mouse goes out of edges.)
  
    touchStart: function(touch) {
      this.mouseDown(touch);
    },
  
    touchEnd: function(touch) {
      this.mouseUp(touch);
    }
  });
  
new_contents: // ==========================================================================
  // Project:   SproutCore Handlebar Views
  // Copyright: ©2011 Strobe Inc. and contributors.
  // License:   Licensed under MIT license (see license.js)
  // ==========================================================================
  
  require('sproutcore-runtime/mixins/target_action_support');
  
  var get = SC.get, set = SC.set;
  
  SC.Button = SC.View.extend(SC.TargetActionSupport, {
    classNames: ['sc-button'],
    classNameBindings: ['isActive'],
  
    tagName: 'button',
    attributeBindings: ['type', 'disabled'],
    type: 'button',
    disabled: false,
    propagateEvents: false,
  
    mouseDown: function() {
      set(this, 'isActive', true);
      this._mouseDown = true;
      this._mouseEntered = true;
      return get(this, 'propagateEvents');
    },
  
    mouseLeave: function() {
      if (this._mouseDown) {
        set(this, 'isActive', false);
        this._mouseEntered = false;
      }
    },
  
    mouseEnter: function() {
      if (this._mouseDown) {
        set(this, 'isActive', true);
        this._mouseEntered = true;
      }
    },
  
    mouseUp: function(event) {
      if (get(this, 'isActive')) {
  
        // Actually invoke the button's target and action.
        // This method comes from the SC.TargetActionSupport mixin.
        this.triggerAction();
        set(this, 'isActive', false);
      }
  
      this._mouseDown = false;
      this._mouseEntered = false;
      return get(this, 'propagateEvents');
    },
  
    // TODO: Handle proper touch behavior.  Including should make inactive when
    // finger moves more than 20x outside of the edge of the button (vs mouse
    // which goes inactive as soon as mouse goes out of edges.)
  
    touchStart: function(touch) {
      this.mouseDown(touch);
    },
  
    touchEnd: function(touch) {
      this.mouseUp(touch);
    }
  });
  
subject: Use SC.get instead of this.get