Sha256: 1cfd202b5d675aeba9b2930ee898284ccbabaa0e16300eaf805b4ee8d4178598

Contents?: true

Size: 1.38 KB

Versions: 6

Compression:

Stored size: 1.38 KB

Contents

// ==========================================================================
// Project:   SproutCore
// Copyright: @2013 7x7 Software, Inc.
// License:   Licensed under MIT license (see license.js)
// ==========================================================================


SC.mixin(SC.View,
  /** @scope SC.View */ {

  /** @class

    @extends SC.ViewTransitionProtocol
    @see SC.View#animate for other timing functions.
    @since Version 1.10
  */
  FADE_IN: {

    /** @private */
    setup: function (view, options, inPlace) {
      view.adjust({ opacity: inPlace ? view.get('layout').opacity || 0 : 0 });
    },

    /** @private */
    run: function (view, options, finalLayout, finalFrame) {
      view.animate('opacity', finalLayout.opacity || 1, {
        delay: options.delay || 0,
        duration: options.duration || 0.4,
        timing: options.timing || 'ease'
      }, function (data) {
        this.didTransitionIn();
      });
    }
  },

  /** @class

    @extends SC.ViewTransitionProtocol
    @see SC.View#animate for other timing functions.
    @since Version 1.10
  */
  FADE_OUT: {

    /** @private */
    run: function (view, options) {
      view.animate('opacity', 0, {
        delay: options.delay || 0,
        duration: options.duration || 0.4,
        timing: options.timing || 'ease'
      }, function (data) {
        this.didTransitionOut();
      });
    }

  }

});

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
sproutcore-1.10.2 lib/frameworks/sproutcore/frameworks/foundation/transitions/fade_transition.js
sproutcore-1.10.1 lib/frameworks/sproutcore/frameworks/foundation/transitions/fade_transition.js
sproutcore-1.10.0 lib/frameworks/sproutcore/frameworks/foundation/transitions/fade_transition.js
sproutcore-1.10.0.rc.3 lib/frameworks/sproutcore/frameworks/foundation/transitions/fade_transition.js
sproutcore-1.10.0.rc.2 lib/frameworks/sproutcore/frameworks/foundation/transitions/fade_transition.js
sproutcore-1.10.0.rc.1 lib/frameworks/sproutcore/frameworks/foundation/transitions/fade_transition.js