Bartosz Dziewoński has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/228295

Change subject: jquery.morphCrossfade: Do not set 'overflow: hidden' permanently
......................................................................

jquery.morphCrossfade: Do not set 'overflow: hidden' permanently

Sometimes we need things to stick out of the panels.

Change-Id: I8b3926177ad5107542a2c219f54ff46011d09f77
---
M resources/jquery/jquery.morphCrossfade.js
1 file changed, 10 insertions(+), 12 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UploadWizard 
refs/changes/95/228295/1

diff --git a/resources/jquery/jquery.morphCrossfade.js 
b/resources/jquery/jquery.morphCrossfade.js
index 2d673a3..0705a25 100644
--- a/resources/jquery/jquery.morphCrossfade.js
+++ b/resources/jquery/jquery.morphCrossfade.js
@@ -47,15 +47,12 @@
                // the elements that are immediate children are the 
crossfadables
                // they must all be "on top" of each other, so position them 
relative
                this.css( {
-                       position: 'relative',
-                       overflow: 'hidden',
-                       scroll: 'none'
+                       position: 'relative'
                } );
                this.children().css( {
                        position: 'absolute',
-                       top: '0px',
-                       left: '0px',
-                       scroll: 'none',
+                       top: 0,
+                       left: 0,
                        opacity: 0,
                        visibility: 'hidden'
                } );
@@ -76,29 +73,30 @@
         * @param speed (optional) how fast to crossfade, in milliseconds
         */
        $.fn.morphCrossfade = function ( newPanelSelector, speed ) {
-               var $containers = this;
                if ( typeof speed === 'undefined' ) {
                        speed = 400;
                }
 
-               $containers.css( { overflow:'hidden' } );
-
-               $.each( $containers, function ( i, container ) {
+               $.each( this, function ( i, container ) {
                        var $container = $( container ),
+                               oldOverflow = $container.css( 'overflow' ),
                                $oldPanel = $( $container.data( 
'crossfadeDisplay' ) ),
                                $newPanel = ( typeof newPanelSelector === 
'string' ) ?
                                        $container.find( newPanelSelector ) : 
$( newPanelSelector );
 
                        if ( $oldPanel.get(0) !== $newPanel.get(0) ) {
-                               if ( $oldPanel ) {
+                               if ( $oldPanel.length ) {
                                        // remove auto setting of height from 
container, and
-                                       // make doubly sure that the container 
height is equal to oldPanel
+                                       // make doubly sure that the container 
height is equal to oldPanel,
+                                       // and prevent now-oversized panels 
from sticking out
                                        $container.css( { height: 
$oldPanel.outerHeight() } );
+                                       $container.css( { overflow: 'hidden' } 
);
                                        // take it out of the flow
                                        $oldPanel.css( { position: 'absolute' } 
);
                                        // fade WITHOUT hiding when opacity = 0
                                        $oldPanel.stop().animate( { opacity: 0 
}, speed, 'linear', function () {
                                                $oldPanel.css( { visibility: 
'hidden' } );
+                                               $container.css( { overflow: 
oldOverflow } );
                                        } );
                                }
                                $container.data( 'crossfadeDisplay', $newPanel 
);

-- 
To view, visit https://gerrit.wikimedia.org/r/228295
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8b3926177ad5107542a2c219f54ff46011d09f77
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UploadWizard
Gerrit-Branch: master
Gerrit-Owner: Bartosz Dziewoński <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to