Sha256: fd9334f038ffb4c2489d7d7ef4a8a16d8cde5cd0b228c2c8abcacd67e741dfec

Contents?: true

Size: 1.14 KB

Versions: 34

Compression:

Stored size: 1.14 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)
// ==========================================================================

/**
  @namespace 

  Use this mixin to automatically mix in a a collection of mixins into all
  child views created _by the view_ (that are created at view initialization).
  
  @since SproutCore 1.0
*/
SC.AutoMixin = {

  /**
    The mixins to automatically mix in.
    @property
  */
  autoMixins: [],
  
  /**
    @private
    Override createChildViews to mix in the mixins defined in autoMixins.
  */
  createChildView: function(v, attrs) {
    if (!attrs) attrs = {};
    attrs.owner = attrs.parentView = this;
    attrs.isVisibleInWindow = this.get('isVisibleInWindow');
    if (!attrs.page) attrs.page = this.page;
    
    var applyMixins = this.get("autoMixins");
    applyMixins.push(attrs);
    
    v = v.create.apply(v, applyMixins);
    return v;
  }

};

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
sproutcore-1.10.1 lib/frameworks/sproutcore/frameworks/foundation/mixins/auto_mixin.js
sproutcore-1.10.0 lib/frameworks/sproutcore/frameworks/foundation/mixins/auto_mixin.js
sproutcore-1.10.0.rc.3 lib/frameworks/sproutcore/frameworks/foundation/mixins/auto_mixin.js
sproutcore-1.10.0.rc.2 lib/frameworks/sproutcore/frameworks/foundation/mixins/auto_mixin.js
sproutcore-1.10.0.rc.1 lib/frameworks/sproutcore/frameworks/foundation/mixins/auto_mixin.js
sproutcore-1.9.2 lib/frameworks/sproutcore/frameworks/foundation/mixins/auto_mixin.js
sproutcore-1.9.1 lib/frameworks/sproutcore/frameworks/foundation/mixins/auto_mixin.js
sproutcore-1.9.0 lib/frameworks/sproutcore/frameworks/foundation/mixins/auto_mixin.js
sproutcore-1.8.2.1 lib/frameworks/sproutcore/frameworks/foundation/mixins/auto_mixin.js
sproutcore-1.8.1 lib/frameworks/sproutcore/frameworks/foundation/mixins/auto_mixin.js
sproutcore-1.8.0 lib/frameworks/sproutcore/frameworks/foundation/mixins/auto_mixin.js
sproutcore-1.7.1.beta-java lib/frameworks/sproutcore/frameworks/foundation/mixins/auto_mixin.js
sproutcore-1.7.1.beta lib/frameworks/sproutcore/frameworks/foundation/mixins/auto_mixin.js
sproutcore-1.6.0.1-java lib/frameworks/sproutcore/frameworks/foundation/mixins/auto_mixin.js
sproutcore-1.6.0.1 lib/frameworks/sproutcore/frameworks/foundation/mixins/auto_mixin.js
sproutcore-1.6.0.1-x86-mingw32 lib/frameworks/sproutcore/frameworks/foundation/mixins/auto_mixin.js
sproutcore-1.6.0 lib/frameworks/sproutcore/frameworks/foundation/mixins/auto_mixin.js
sproutcore-1.6.0-java lib/frameworks/sproutcore/frameworks/foundation/mixins/auto_mixin.js
sproutcore-1.6.0.rc.2-x86-mingw32 lib/frameworks/sproutcore/frameworks/foundation/mixins/auto_mixin.js
sproutcore-1.6.0.rc.2 lib/frameworks/sproutcore/frameworks/foundation/mixins/auto_mixin.js