mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-09-23 10:22:05 +00:00
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:
parent
9db03278b8
commit
9e206ef8f5
|
@ -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 () {
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
( function ( mw ) {
|
||||
mw.echo = mw.echo || {};
|
||||
mw.echo.config = mw.echo.config || { maxPrioritizedActions: 2 };
|
||||
} )( mediaWiki );
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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',
|
||||
|
|
Loading…
Reference in a new issue