Ticket #5689: expandoPane_20080219.patch

File expandoPane_20080219.patch, 1.5 kB (added by sfoster, 6 months ago)

[CLA] [PATCH] Adds (partial) support for vertical orientation expand/collapse.

  • layout/ExpandoPane.js

     
    3131        // duration: Integer 
    3232        //              duration to run show/hide animations 
    3333        duration:420, 
    34  
     34         
    3535        postCreate:function(){ 
    3636 
    3737                this.inherited(arguments); 
    3838                this._animConnects = []; 
     39 
     40                this._isHorizontal = true; 
     41                 
    3942                this._container = this.getParent(); 
    4043                this._titleHeight = dojo._getBorderBox(this.titleWrapper).h + 2; 
    4144         
     
    5558                                        dojo.addClass(this.titleWrapper,"iconRight"); 
    5659                                        break; 
    5760                        } 
     61                        this.isHorizontal = !/top|bottom/.test(region); 
    5862                } 
    5963                this._setupAnims(); 
    6064        }, 
     
    6670                        node:this.domNode, 
    6771                        duration:this.duration 
    6872                }; 
     73 
     74                var isHorizontal = this._isHorizontal; 
     75                var showProps = {}, hideProps = {}, dimension = isHorizontal ? "width" : "height";  
     76 
     77                showProps[dimension] = {  
     78                        end:this[( isHorizontal ? "maxWidth" : "maxHeight")] || 275,  
     79                        unit:"px"  
     80                }; 
     81                hideProps[dimension] = {  
     82                        end: (this._titleHeight - 6),  
     83                        unit:"px" 
     84                }; 
     85 
    6986                this._showAnim = dojo.animateProperty(dojo.mixin(_common,{ 
    7087                        easing:this.easeIn, 
    71                         properties: { 
    72                                 width:{ end:this.maxWidth||275, unit:"px" } 
    73                         } 
     88                        properties: showProps  
    7489                })); 
    7590                this._hideAnim = dojo.animateProperty(dojo.mixin(_common,{ 
    7691                        easing:this.easeOut, 
    77                         properties: { 
    78                                 width:{ 
    79                                         end: (this._titleHeight - 6), unit:"px" 
    80                                 } 
    81                         } 
     92                        properties: hideProps 
    8293                })); 
    8394 
    8495                this._animConnects = [