r87745 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r87744‎ | r87745 | r87746 >
Date:17:26, 9 May 2011
Author:neilk
Status:ok
Tags:
Comment:
prevent animation buildup, use stop()
Modified paths:
  • /trunk/extensions/UploadWizard/resources/jquery/jquery.morphCrossfade.js (modified) (history)

Diff [purge]

Index: trunk/extensions/UploadWizard/resources/jquery/jquery.morphCrossfade.js
@@ -97,20 +97,20 @@
9898 // take it out of the flow
9999 $oldPanel.css( { position: 'absolute' } );
100100 // fade WITHOUT hiding when opacity = 0
101 - $oldPanel.animate( { opacity: 0 }, speed, 'linear', function() {
 101+ $oldPanel.stop().animate( { opacity: 0 }, speed, 'linear', function() {
102102 $oldPanel.css( { visibility: 'hidden'} );
103103 } );
104104 }
105105 $container.data( 'crossfadeDisplay', $newPanel );
106106
107107 $newPanel.css( { visibility: 'visible' } );
108 - $container.animate( { height: $newPanel.outerHeight() }, speed, 'linear', function() {
 108+ $container.stop().animate( { height: $newPanel.outerHeight() }, speed, 'linear', function() {
109109 // we place it back into the flow, in case its size changes.
110110 $newPanel.css( { position: 'relative' } );
111111 // and allow the container to grow with it.
112112 $container.css( { height : 'auto' } );
113113 } );
114 - $newPanel.animate( { opacity: 1 }, speed );
 114+ $newPanel.stop().animate( { opacity: 1 }, speed );
115115 }
116116 } );
117117

Status & tagging log