Merge "mw.notification: fix error on notif. close with $.fx.off=true"
authorTheDJ <hartman.wiki@gmail.com>
Sun, 4 Nov 2012 12:18:48 +0000 (12:18 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Sun, 4 Nov 2012 12:18:48 +0000 (12:18 +0000)
resources/mediawiki/mediawiki.notification.js

index 5bcbfcc..58a3ab6 100644 (file)
                        } )
                        // Fix the top/left position to the current computed position from which we
                        // can animate upwards.
-                       .css( this.$notification.position() )
-                       // Animate opacity and top to create fade upwards animation for notification closing
+                       .css( this.$notification.position() );
+
+               // This needs to be done *after* notification's position has been made absolute.
+               if ( options.placeholder ) {
+                       // Insert a placeholder with a height equal to the height of the
+                       // notification plus it's vertical margins in place of the notification
+                       var $placeholder = $( '<div>' )
+                               .css( 'height', this.$notification.outerHeight( true ) )
+                               .insertBefore( this.$notification );
+               }
+
+               // Animate opacity and top to create fade upwards animation for notification closing
+               this.$notification
                        .animate( {
                                opacity: 0,
                                top: '-=35'
                                        }
                                }
                        } );
-
-               if ( options.placeholder ) {
-                       // Insert a placeholder with a height equal to the height of the
-                       // notification plus it's vertical margins in place of the notification
-                       var $placeholder = $( '<div>' )
-                               .css( 'height', this.$notification.outerHeight( true ) )
-                               .insertBefore( this.$notification );
-               }
        };
 
        /**