Bug Tracker

Changeset 2242

Show
Ignore:
Timestamp:
07/05/07 04:27:46 (1 year ago)
Author:
jeresig
Message:

Overflow revert was completely borked when you animated multiple properties (like in .show() or .hide()) (see bug #1343).

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/jquery/src/fx/fx.js

    r2131 r2242  
    316316                self = this; 
    317317             
    318             for ( var p in prop ) 
     318            for ( var p in prop ) { 
    319319                if ( prop[p] == "hide" && hidden || prop[p] == "show" && !hidden ) 
    320320                    return jQuery.isFunction(opt.complete) && opt.complete.apply(this); 
     321 
     322                if ( p == "height" || p == "width" ) { 
     323                    // Store display property 
     324                    opt.display = jQuery.css(this, "display"); 
     325 
     326                    // Make sure that nothing sneaks out 
     327                    opt.overflow = this.style.overflow; 
     328                } 
     329            } 
     330 
     331            if ( opt.overflow != null ) 
     332                this.style.overflow = "hidden"; 
    321333 
    322334            this.curAnim = jQuery.extend({}, prop); 
     
    423435        var y = elem.style; 
    424436         
    425         if ( prop == "height" || prop == "width" ) { 
    426             // Store display property 
    427             var oldDisplay = jQuery.css(elem, "display"); 
    428  
    429             // Make sure that nothing sneaks out 
    430             var oldOverflow = y.overflow; 
    431             y.overflow = "hidden"; 
    432         } 
    433  
    434437        // Simple function for setting a style value 
    435438        z.a = function(){ 
     
    530533 
    531534                if ( done ) { 
    532                     if ( oldDisplay != null ) { 
     535                    if ( options.display != null ) { 
    533536                        // Reset the overflow 
    534                         y.overflow = oldOverflow; 
     537                        y.overflow = options.overflow; 
    535538                     
    536539                        // Reset the display 
    537                         y.display = oldDisplay; 
     540                        y.display = options.display; 
    538541                        if ( jQuery.css(elem, "display") == "none" ) 
    539542                            y.display = "block";