Sha256: 45f941ddd6d5d76317bc6dbf97023433e4d7ce6f512190d4bbbea019c8878eb3

Contents?: true

Size: 1.46 KB

Versions: 4

Compression:

Stored size: 1.46 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
    @since Version 1.10
  */
  SCALE_IN: {

    /* @private */
    layoutProperties: ['scale'],

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

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

  /** @class

    @extends SC.ViewTransitionProtocol
    @since Version 1.10
  */
  SCALE_OUT: {

    /* @private */
    layoutProperties: ['scale'],

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

  }
});

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
sproutcore-1.11.0 lib/frameworks/sproutcore/frameworks/foundation/transitions/scale_transition.js
sproutcore-1.11.0.rc3 lib/frameworks/sproutcore/frameworks/foundation/transitions/scale_transition.js
sproutcore-1.11.0.rc2 lib/frameworks/sproutcore/frameworks/foundation/transitions/scale_transition.js
sproutcore-1.11.0.rc1 lib/frameworks/sproutcore/frameworks/foundation/transitions/scale_transition.js