Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/348518 )

Change subject: Notification icon tweak for better IE support
......................................................................

Notification icon tweak for better IE support

Rather than trying to include 2 indicators (the bell and the
counter only render one at any given time)

This introduces a slight change in behaviour to keep implementation
simple:
* If user has notifications, clicks icon and
clears notifications, on returning to the page the notification
icon will read 0 rather than showing a bell. Refreshing the page
will show the bell.

Bug: T162647
Change-Id: I083be7e795a9b0d60cd9be7688c519421d3279d0
---
M includes/skins/minerva.mustache
M includes/skins/secondaryButton.mustache
M resources/mobile.notifications.overlay/NotificationsOverlay.js
M resources/skins.minerva.base.styles/ui.less
4 files changed, 10 insertions(+), 11 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend 
refs/changes/18/348518/1

diff --git a/includes/skins/minerva.mustache b/includes/skins/minerva.mustache
index 061ee46..5e12313 100644
--- a/includes/skins/minerva.mustache
+++ b/includes/skins/minerva.mustache
@@ -32,4 +32,4 @@
                {{>footer}}
        </div>
 </div>
-<!-- v:6 -->
+<!-- v:7.2 -->
diff --git a/includes/skins/secondaryButton.mustache 
b/includes/skins/secondaryButton.mustache
index d57d176..4e2d53d 100644
--- a/includes/skins/secondaryButton.mustache
+++ b/includes/skins/secondaryButton.mustache
@@ -1,8 +1,11 @@
+{{^hasUnseenNotifications}}
 <a href="{{href}}" title="{{title}}"
    class="{{class}} user-button main-header-button" id="secondary-button">
     {{title}}
 </a>
-<div title="{{title}}" class="notification-count
+{{/hasUnseenNotifications}}
+{{#hasUnseenNotifications}}
+<div title="{{title}}" class="notification-count user-button
             {{#isNotificationCountZero}}zero{{/isNotificationCountZero}}
     {{#hasUnseenNotifications}}notification-unseen{{/hasUnseenNotifications}}">
        <div class="circle">
@@ -11,3 +14,4 @@
                </span>
        </div>
 </div>
+{{/hasUnseenNotifications}}
diff --git a/resources/mobile.notifications.overlay/NotificationsOverlay.js 
b/resources/mobile.notifications.overlay/NotificationsOverlay.js
index 98aa308..5907587 100644
--- a/resources/mobile.notifications.overlay/NotificationsOverlay.js
+++ b/resources/mobile.notifications.overlay/NotificationsOverlay.js
@@ -171,14 +171,14 @@
                        var $badgeCounter = this.$badge.find( 
'.notification-count' );
                        this.count = 
this.controller.manager.getUnreadCounter().getCappedNotificationCount( count );
 
-                       if ( this.count > 0 ) {
+                       if ( this.count >= 0 ) {
                                $badgeCounter.find( 'span' ).text(
                                        mw.msg( 'echo-badge-count', 
mw.language.convertNumber( this.count ) )
                                ).show();
-                       } else {
-                               $badgeCounter.hide();
                        }
-
+                       if ( this.count === 0 ) {
+                               
$badgeCounter.removeClass('notification-unseen');
+                       }
                        this.checkShowMarkAllRead();
                },
                /**
diff --git a/resources/skins.minerva.base.styles/ui.less 
b/resources/skins.minerva.base.styles/ui.less
index efaed2d..9454c2f 100644
--- a/resources/skins.minerva.base.styles/ui.less
+++ b/resources/skins.minerva.base.styles/ui.less
@@ -338,11 +338,6 @@
 .notification-count {
        @circleSize: 24px;
        @borderSize: 2px;
-       position: absolute;
-       top: 0;
-       right: 0;
-       bottom: 0;
-       left: 0;
        margin: auto;
        height: @circleSize;
        background: @notificationBackgroundRead;

-- 
To view, visit https://gerrit.wikimedia.org/r/348518
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I083be7e795a9b0d60cd9be7688c519421d3279d0
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson <jrob...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to