Changeset 693 for ether_statistics


Ignore:
Timestamp:
01/07/13 18:43:16 (12 years ago)
Author:
vmipsl
Message:

rollable slide with min-height

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ether_statistics/web/resources/js/classesForJQuery/DragSlide.js

    r692 r693  
    1717        this.titleId = objectParameter.titleId; 
    1818        this.contentId = objectParameter.contentId; 
    19         this.width = objectParameter.minWidth ? objectParameter.minWidth : objectParameter.width; 
    20         this.height = objectParameter.minHeight ? objectParameter.minHeight : objectParameter.height; 
    21         this.minWidth = objectParameter.minWidth ? objectParameter.minWidth : objectParameter.width; 
    22         this.minHeight = objectParameter.minHeight ? objectParameter.minHeight : objectParameter.height; 
     19        this.width = objectParameter.width ? objectParameter.width : false; 
     20        this.height = objectParameter.height ? objectParameter.height : false; 
     21        this.minWidth = objectParameter.minWidth ? objectParameter.minWidth : false; 
     22        this.minHeight = objectParameter.minHeight ? objectParameter.minHeight : false; 
    2323        this.top = objectParameter.top; 
    2424        this.left = objectParameter.left; 
     
    3737        if( this.specificClass ) 
    3838            this.divContainer.addClass( this.specificClass ); 
    39         this.divContainer.attr( {id:this.id, style:"width:" + this.width + "px; height:" + this.height + "px; min-width:" + this.minWidth + "px; min-height:" + this.minHeight + "px; top:" + this.top + "; left:" + this.left} ); 
    4039 
    4140        // Title 
     
    5251        this.divContent.html( this.contentSlide ); 
    5352        this.divContainer.append( this.divContent ); 
     53 
     54        // Height and width or min-height and min-width 
     55        if( this.height && this.width ) 
     56            this.divContainer.attr( {id:this.id, style:"width:" + this.width + "px; height:" + this.height + "px; top:" + this.top + "; left:" + this.left} ); 
     57        else 
     58            this.divContainer.attr( {id:this.id, style:"min-width:" + this.minWidth + "px; min-height:" + this.minHeight + "px; height:" + this.divTitle.height() + "px; top:" + this.top + "; left:" + this.left} ); 
     59 
    5460 
    5561        this.parent.append( this.divContainer ); 
     
    102108    onDbClickTitle: function() 
    103109    { 
    104         if( this.height == this.divContainer.height() ) 
     110        if( (this.height == this.divContainer.height()) || (this.minHeight == this.divContainer.height()) ) 
    105111            this.hideContainerContent(); 
    106112        else 
     
    110116    hideContainerContent: function() 
    111117    { 
    112         this.divContainer.css( 'min-height', '0px' ).animate( { 
    113             height:this.divTitle.height() + 'px' 
    114         }, 1000, jQuery.proxy( function() 
     118        if( this.minHeight ) 
    115119        { 
    116             this.divContent.hide(); 
    117         }, this ) ); 
     120            this.divContainer.css( 'min-height', '0px' ); 
     121            this.divContainer.css( 'height', this.minHeight + 'px' ).animate( { 
     122                height:this.divTitle.height() + 'px' 
     123            }, 1000, jQuery.proxy( function() 
     124            { 
     125                this.divContent.hide(); 
     126            }, this ) ); 
     127        } 
     128        else 
     129        { 
     130            this.divContainer.animate( { 
     131                height:this.divTitle.height() + 'px' 
     132            }, 1000, jQuery.proxy( function() 
     133            { 
     134                this.divContent.hide(); 
     135            }, this ) ); 
     136        } 
    118137    }, 
    119138 
    120139    showContainerContent: function() 
    121140    { 
    122         this.divContainer.css( 'min-height', this.minHeight + 'px' ).animate( { 
    123             height:this.height + 'px' 
    124         }, 1000, jQuery.proxy( function() 
     141        if( this.minHeight ) 
    125142        { 
    126             this.divContent.show(); 
    127         }, this ) ); 
     143            this.divContainer.animate( { 
     144                height:this.minHeight + 'px' 
     145            }, 1000, jQuery.proxy( function() 
     146            { 
     147                this.divContainer.css( 'min-height', this.minHeight + 'px' ); 
     148                this.divContainer.css( 'height', this.divTitle.height() + 'px' ); 
     149                this.divContent.show(); 
     150            }, this ) ); 
     151        } 
     152        else 
     153        { 
     154            this.divContainer.animate( { 
     155                height:this.height + 'px' 
     156            }, 1000, jQuery.proxy( function() 
     157            { 
     158                this.divContent.show(); 
     159            }, this ) ); 
     160        } 
    128161    }, 
    129162 
Note: See TracChangeset for help on using the changeset viewer.