Sha256: 4222732b11d068be96bd9e3dd87eb1e0098e974b16cd2784565a1bb49c6dc57d

Contents?: true

Size: 1.34 KB

Versions: 7

Compression:

Stored size: 1.34 KB

Contents

// ==========================================================================
// Project:   SproutCore - JavaScript Application Framework
// Copyright: ©2006-2011 Strobe 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

7 entries across 7 versions & 2 rubygems

Version Path
spade-0.0.1 sproutcore/frameworks/table/mixins/table_delegate.js
sproutcore-1.5.0.pre.5 lib/frameworks/sproutcore/frameworks/table/mixins/table_delegate.js
sproutcore-1.5.0.pre.4.1 lib/frameworks/sproutcore/frameworks/table/mixins/table_delegate.js
sproutcore-1.5.0.pre.4 lib/frameworks/sproutcore/frameworks/table/mixins/table_delegate.js
sproutcore-1.5.0.pre.3 lib/frameworks/sproutcore/frameworks/table/mixins/table_delegate.js
sproutcore-1.4.5 lib/frameworks/sproutcore/frameworks/table/mixins/table_delegate.js
sproutcore-1.4.5-java lib/frameworks/sproutcore/frameworks/table/mixins/table_delegate.js