Krinkle has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/382228 )
Change subject: mediawiki.notification: Use css() instead of slow show()/hide()
......................................................................
mediawiki.notification: Use css() instead of slow show()/hide()
There is a lot of complexity and overhead involved with show()
and hide() methods for back-compat and edge cases that we don't
want to involve here (such as storing the last known display,
figuring out the default display, dealing with elements hidden
by default via CSS rules etc.).
We know the stylesheet does not hide the element by default, so
we merely need to set or unset the 'display: none;' inline style.
Ref T159911.
Change-Id: Ia22a2adddddf8514368124d93e3a753440814d97
---
M resources/src/mediawiki/mediawiki.notification.js
1 file changed, 3 insertions(+), 3 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/28/382228/1
diff --git a/resources/src/mediawiki/mediawiki.notification.js
b/resources/src/mediawiki/mediawiki.notification.js
index dfacfc6..c213cd2 100644
--- a/resources/src/mediawiki/mediawiki.notification.js
+++ b/resources/src/mediawiki/mediawiki.notification.js
@@ -102,7 +102,7 @@
Notification.prototype.start = function () {
var options, $notification, $tagMatches, autohideCount;
- $area.show();
+ $area.css( 'display', '' );
if ( this.isOpen ) {
return;
@@ -230,7 +230,7 @@
if ( openNotificationCount === 0 ) {
// Hide the area after the last
notification closes. Otherwise, the padding on
// the area can be obscure content,
despite the area being empty/invisible (T54659). // FIXME
- $area.hide();
+ $area.css( 'display', 'none' );
notif.$notification.remove();
} else {
notif.$notification.slideUp( 'fast',
function () {
@@ -291,7 +291,7 @@
// Prepend the notification area to the content area and save
it's object.
mw.util.$content.prepend( $area );
offset = $area.offset();
- $area.hide();
+ $area.css( 'display', 'none' );
function updateAreaMode() {
var shouldFloat = window.pageYOffset > offset.top;
--
To view, visit https://gerrit.wikimedia.org/r/382228
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia22a2adddddf8514368124d93e3a753440814d97
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Krinkle <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits