From b76f0c0571451672858735fa97e6980dca1741d8 Mon Sep 17 00:00:00 2001 From: Matt Russell Date: Mon, 5 Oct 2015 15:00:43 +1100 Subject: [PATCH] Fix mw.notify not being visible if first loaded when scrolled down This regression was caused by using $().offset() on a hidden element, which returns the current scroll position making the script think the notification area starts where the scroll position is, so it would not become fixed until you scroll further. Bug: T114606 Change-Id: Ice62cf3ea7b1a29e33baeca05d1a088a68c9a785 --- resources/src/mediawiki/mediawiki.notification.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/src/mediawiki/mediawiki.notification.js b/resources/src/mediawiki/mediawiki.notification.js index f361ec86de..eeb7bb37ea 100644 --- a/resources/src/mediawiki/mediawiki.notification.js +++ b/resources/src/mediawiki/mediawiki.notification.js @@ -393,12 +393,12 @@ // on links from hiding a notification. .on( 'click', 'a', function ( e ) { e.stopPropagation(); - } ) - .hide(); + } ); // Prepend the notification area to the content area and save it's object. mw.util.$content.prepend( $area ); offset = $area.offset(); + $area.hide(); function updateAreaMode() { var isFloating = $window.scrollTop() > offset.top; -- 2.20.1