Reduce number of prioritized actions in mobile

For mobile view, only display 1 prioritized action in the items,
and for general desktop view, stick to the default 2.

Bug: T141788
Change-Id: Ibf386ee598553ecfb717f07f02688034bbc338c8
This commit is contained in:
Moriel Schottlender 2016-08-01 16:31:18 -07:00
parent 9db03278b8
commit 9e206ef8f5
4 changed files with 10 additions and 1 deletions

View file

@ -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 () {

View file

@ -1,3 +1,4 @@
( function ( mw ) {
mw.echo = mw.echo || {};
mw.echo.config = mw.echo.config || { maxPrioritizedActions: 2 };
} )( mediaWiki );

View file

@ -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,

View file

@ -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',