Sha256: 5d1544b5f019ce212b47330afcbcedfd2fe0232d687a0dfdf850a144e2a3964a

Contents?: true

Size: 1.35 KB

Versions: 11

Compression:

Stored size: 1.35 KB

Contents

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

/**
  A delegate for table resize operations.
*/
SC.TableDelegate = {
  /**
    Walk like a duck.
  */
  isTableDelegate: YES,
  
  /**
    Called just before a table resizes a column to a proposed width.  You
    can use this method to constrain the allowed width.  The default 
    implementation uses the minWidth and maxWidth of the column object.
  */
  tableShouldResizeColumnTo: function(table, column, proposedWidth) {
    var min = column.get('minWidth') || 0,
        max = column.get('maxWidth') || proposedWidth;
    
    proposedWidth = Math.max(min, proposedWidth);
    proposedWidth = Math.min(max, proposedWidth);
    
    return proposedWidth;
  },
  
  tableShouldResizeWidthTo: function(table, proposedWidth) {
    var min = table.get('minWidth') || 0,
        max = table.get('maxWidth') || proposedWidth;
        
    proposedWidth = Math.max(min, proposedWidth);
    proposedWidth = Math.min(max, proposedWidth);
    
    return proposedWidth;
  }
};

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
sproutcore-1.4.4-java lib/frameworks/sproutcore/frameworks/table/mixins/table_delegate.js
sproutcore-1.4.4 lib/frameworks/sproutcore/frameworks/table/mixins/table_delegate.js
sproutcore-1.4.3.1 lib/frameworks/sproutcore/frameworks/table/mixins/table_delegate.js
sproutcore-1.4.3-java lib/frameworks/sproutcore/frameworks/table/mixins/table_delegate.js
sproutcore-1.4.3 lib/frameworks/sproutcore/frameworks/table/mixins/table_delegate.js
sproutcore-1.4.2-java lib/frameworks/sproutcore/frameworks/table/mixins/table_delegate.js
sproutcore-1.4.2 lib/frameworks/sproutcore/frameworks/table/mixins/table_delegate.js
sproutcore-1.4.1-java lib/frameworks/sproutcore/frameworks/table/mixins/table_delegate.js
sproutcore-1.4.1 lib/frameworks/sproutcore/frameworks/table/mixins/table_delegate.js
sproutcore-1.4.0-java lib/frameworks/sproutcore/frameworks/table/mixins/table_delegate.js
sproutcore-1.4.0 lib/frameworks/sproutcore/frameworks/table/mixins/table_delegate.js