Sha256: 06b7790fa41ac65724742a18e7e3058ad8e41fd8de0115310bcbf11f2933fe2b

Contents?: true

Size: 1.98 KB

Versions: 11

Compression:

Stored size: 1.98 KB

Contents

// ==========================================================================
// Project:   SproutCore - JavaScript Application Framework
// Copyright: ©2006-2011 Strobe Inc. and contributors.
//            Portions ©2008-2011 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: 'my-image-button-icon'
      });

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

      $theme.image-button .my-image-button-icon {
        @include slice('my-image-button-image.png');

        // and an active state:
        &.active {
          @include slice('my-image-button-image-active.png');
        }
      }

  Note: in addition to using SCSS and the Chance directives shown above, you
  can use normal CSS syntax and sc_static.

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

  /**
    @type Array
    @default ['sc-image-button-view']
    @see SC.View#classNames
  */
  classNames: ['sc-image-button-view'],

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

    @type String
    @default null
  */
  themeName: null,

  /**
    @type String
    @default 'imageButtonRenderDelegate'
  */
  renderDelegateName: 'imageButtonRenderDelegate',

  /**
    @type Array
    @default ['image']
  */
  displayProperties: ['image'],

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

    @type String
    @default null
  */
  image: null

});

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
sproutcore-1.11.0 lib/frameworks/sproutcore/frameworks/desktop/views/image_button.js
sproutcore-1.11.0.rc3 lib/frameworks/sproutcore/frameworks/desktop/views/image_button.js
sproutcore-1.11.0.rc2 lib/frameworks/sproutcore/frameworks/desktop/views/image_button.js
sproutcore-1.11.0.rc1 lib/frameworks/sproutcore/frameworks/desktop/views/image_button.js
sproutcore-1.10.3.1 lib/frameworks/sproutcore/frameworks/desktop/views/image_button.js
sproutcore-1.10.2 lib/frameworks/sproutcore/frameworks/desktop/views/image_button.js
sproutcore-1.10.1 lib/frameworks/sproutcore/frameworks/desktop/views/image_button.js
sproutcore-1.10.0 lib/frameworks/sproutcore/frameworks/desktop/views/image_button.js
sproutcore-1.10.0.rc.3 lib/frameworks/sproutcore/frameworks/desktop/views/image_button.js
sproutcore-1.10.0.rc.2 lib/frameworks/sproutcore/frameworks/desktop/views/image_button.js
sproutcore-1.10.0.rc.1 lib/frameworks/sproutcore/frameworks/desktop/views/image_button.js