Sha256: 7e348c6cd8518774a56372b6927992369d77a5c3793f579437e58dcaa918ebd3

Contents?: true

Size: 1.8 KB

Versions: 5

Compression:

Stored size: 1.8 KB

Contents

// ==========================================================================
// Project:   SproutCore - JavaScript Application Framework
// Copyright: ©2006-2011 Strobe Inc. and contributors.
//            Portions ©2008-2010 Apple Inc. All rights reserved.
// License:   Licensed under MIT license (see license.js)
// ==========================================================================

/** @class

  Provides a button that displays an image instead of the standard button
  user interface.

  It behaves the same as an SC.ButtonView, but has an image property that
  should be set to a unique class name.

  For example:

  SC.ImageButtonView.create({
    action: 'imageButtonWasClicked',

    image: 'image-button-icon'
  });

  You could then add some CSS rule for a normal state:

    .sc-image-button-view .image-button-icon {
      background: sc_static('image-button-image');
    }

  And an active state:

    .sc-image-button-view.active .image-button-icon {
      background: sc_static('image-button-image-active');
    }

  @extends SC.View
  @extends SC.Control
  @extends SC.ButtonView
  @since SproutCore 1.5
*/
SC.ImageButtonView = SC.ButtonView.extend(
/** @scope SC.ImageButtonView.prototype */ {

  /**
    Class names that will be applied to this view

    @property {Array}
  */
  classNames: ['sc-image-button-view'],

  /**
    Unlike SC.ButtonView, SC.ImageButtonView does not have a default theme
    that needs to be applied for backwards compatibility.

    @property {String}
  */
  themeName: null,

  /**
    The name of the theme's SC.ImageButtonView render delegate.

    @property {String}
  */
  renderDelegateName: 'imageButtonRenderDelegate',
  
  displayProperties: ['image'],

  /**
    A class name that will be applied to the img tag of the button.

    @property {String}
  */
  image: null
}) ;

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
spade-0.0.1 sproutcore/frameworks/desktop/views/image_button.js
sproutcore-1.5.0.pre.5 lib/frameworks/sproutcore/frameworks/desktop/views/image_button.js
sproutcore-1.5.0.pre.4.1 lib/frameworks/sproutcore/frameworks/desktop/views/image_button.js
sproutcore-1.5.0.pre.4 lib/frameworks/sproutcore/frameworks/desktop/views/image_button.js
sproutcore-1.5.0.pre.3 lib/frameworks/sproutcore/frameworks/desktop/views/image_button.js