From 6c5b246ab7564f0115bedd20d46ed12ea72b331a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bartosz=20Dziewo=C5=84ski?= Date: Thu, 23 Jan 2014 20:47:18 +0100 Subject: [PATCH] mediawiki.notification: Hide #mw-notification-area when it's empty We need to hide the area manually, since it has padding, causing it to obscure whatever is behind it in spite of being invisible. Bug: 52659 Change-Id: I54e51b392673bc361af4e7bf703df75b83d783d4 --- RELEASE-NOTES-1.23 | 2 ++ resources/mediawiki/mediawiki.notification.js | 12 ++++++++++++ 2 files changed, 14 insertions(+) diff --git a/RELEASE-NOTES-1.23 b/RELEASE-NOTES-1.23 index be53faf74f..3f09b81217 100644 --- a/RELEASE-NOTES-1.23 +++ b/RELEASE-NOTES-1.23 @@ -142,6 +142,8 @@ production. * (bug 60543) Special:PrefixIndex forgot stripprefix=1 for "Next page" link * (bug 29762) Undoing an already-undone edit will now display an appropriate message instead of leading the user to make a null edit. +* (bug 52659) mediawiki.notification: Notification area remained visible when + empty and thus was stealing pointer events from links on the page. === Web API changes in 1.23 === * (bug 54884) action=parse&prop=categories now indicates hidden and missing diff --git a/resources/mediawiki/mediawiki.notification.js b/resources/mediawiki/mediawiki.notification.js index f142fa4183..b5fd69c307 100644 --- a/resources/mediawiki/mediawiki.notification.js +++ b/resources/mediawiki/mediawiki.notification.js @@ -4,6 +4,8 @@ var notification, // The #mw-notification-area div that all notifications are contained inside. $area, + // Number of open notification boxes at any time + openNotificationCount = 0, isPageReady = false, preReadyNotifQueue = []; @@ -96,11 +98,14 @@ autohideCount, notif; + $area.show(); + if ( this.isOpen ) { return; } this.isOpen = true; + openNotificationCount++; options = this.options; $notification = this.$notification; @@ -268,6 +273,7 @@ return; } this.isOpen = false; + openNotificationCount--; // Clear any remaining timeout on close this.pause(); @@ -319,6 +325,12 @@ complete: function () { // Remove the notification $( this ).remove(); + // Hide the area manually after closing the last notification, since it has padding, + // causing it to obscure whatever is behind it in spite of being invisible (bug 52659). + // It's okay to do this before getting rid of the placeholder, as it's invisible as well. + if ( openNotificationCount === 0 ) { + $area.hide(); + } if ( options.placeholder ) { // Use a fast slide up animation after closing to make it look like the notifications // below slide up into place when the notification disappears -- 2.20.1