From: Matt Russell Date: Mon, 5 Oct 2015 04:00:43 +0000 (+1100) Subject: Fix mw.notify not being visible if first loaded when scrolled down X-Git-Tag: 1.31.0-rc.0~9376^2 X-Git-Url: https://git.cyclocoop.org/%242?a=commitdiff_plain;h=b76f0c0571451672858735fa97e6980dca1741d8;p=lhc%2Fweb%2Fwiklou.git 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 --- 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;