diff --git a/modules/ext.echo.init.js b/modules/ext.echo.init.js index 990cb14ba..1b925a8b8 100644 --- a/modules/ext.echo.init.js +++ b/modules/ext.echo.init.js @@ -9,6 +9,9 @@ } mw.echo = mw.echo || {}; + mw.echo.config = mw.echo.config || {}; + // Set default max prioritized action links per item + mw.echo.config.maxPrioritizedActions = 2; // Activate ooui $( document ).ready( function () { diff --git a/modules/mw.echo.js b/modules/mw.echo.js index fa65f53c6..12877e81d 100644 --- a/modules/mw.echo.js +++ b/modules/mw.echo.js @@ -1,3 +1,4 @@ ( function ( mw ) { mw.echo = mw.echo || {}; + mw.echo.config = mw.echo.config || { maxPrioritizedActions: 2 }; } )( mediaWiki ); diff --git a/modules/special/ext.echo.special.js b/modules/special/ext.echo.special.js index bf1c20d84..096894b5c 100644 --- a/modules/special/ext.echo.special.js +++ b/modules/special/ext.echo.special.js @@ -1,5 +1,6 @@ ( function ( $, mw ) { 'use strict'; + /*! * Echo Special:Notifications page initialization */ @@ -28,6 +29,10 @@ modelManager ); + // Set default max prioritized action links per item. + // For general purpose we have 2, for mobile only 1 + mw.echo.config.maxPrioritizedActions = mw.config.get( 'skin' ) === 'minerva' ? 1 : 2; + specialPageContainer = new mw.echo.ui.NotificationsInboxWidget( controller, modelManager, diff --git a/modules/ui/mw.echo.ui.NotificationItemWidget.js b/modules/ui/mw.echo.ui.NotificationItemWidget.js index b1ad36f4e..b2e4cc028 100644 --- a/modules/ui/mw.echo.ui.NotificationItemWidget.js +++ b/modules/ui/mw.echo.ui.NotificationItemWidget.js @@ -130,7 +130,7 @@ // prioritized explicitly, *except* for items inside a bundle // (where all actions are inside the menu) or there are more than // two prioritized actions (all others go into the menu) - isOutsideMenu = !this.bundle && urlObj.prioritized !== undefined && outsideMenuItemCounter < 2; + isOutsideMenu = !this.bundle && urlObj.prioritized !== undefined && outsideMenuItemCounter < mw.echo.config.maxPrioritizedActions; linkButton = new mw.echo.ui.MenuItemWidget( { icon: urlObj.icon || 'next',