EBernhardson has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/158820

Change subject: Show alerts tab if active notifications and no messages
......................................................................

Show alerts tab if active notifications and no messages

Bug: 70461
Change-Id: I06daa3f7d526beeb878eb343c169e01acd49e71f
---
M modules/overlay/ext.echo.overlay.js
1 file changed, 12 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Echo 
refs/changes/20/158820/1

diff --git a/modules/overlay/ext.echo.overlay.js 
b/modules/overlay/ext.echo.overlay.js
index c798570..36e8a3a 100644
--- a/modules/overlay/ext.echo.overlay.js
+++ b/modules/overlay/ext.echo.overlay.js
@@ -347,7 +347,18 @@
                                self.tabs.push( tab );
                                self.notificationCount.all += 
notifications[tabOptions.name].index.length;
                        } );
-                       this._activeTab = this.tabs[0];
+
+                       if (
+                               tabs.length === 2
+                               && notifications.message.rawcount === 0
+                               && notifications.alert.rawcount !== 0
+                       ) {
+                               // If we have alerts but no messages activate 
that tab
+                               this._activeTab = this.tabs[1];
+                       } else {
+                               // tab 0 is active by default con
+                               this._activeTab = this.tabs[0];
+                       }
 
                        $overlay.prepend( this._getTitleElement() );
                        $overlay.append( this._getFooterElement() );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I06daa3f7d526beeb878eb343c169e01acd49e71f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Echo
Gerrit-Branch: master
Gerrit-Owner: EBernhardson <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to