mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/MinervaNeue
synced 2024-11-17 19:21:39 +00:00
c0f08790ea
Note: this agitates T230232 again - when merging this please make sure a merge for I929090848f3e04647a97f4979ec78682623fa070 is pending. In various places we try to override the default mw-ui-icon behaviours The hacks need to be removed as part of addressing the core problem. Changes: * Wherever we use mw-ui-icon-before in PHP - wrap the label with a span so that label font-size is altered where needed - not the icon * Where a small icon is needed us isSmall parameter for the Icon component * Apply font-size to labels of mw-ui-icon-before elements * The browser tests need a slight update to access the span element inside a menu item - in the case of the logout button the label is always hidden, so we need to check the visibility of the parent element (secondary_action) Bug: T229440 Depends-On: I3f803ec4c9068b30aa93b803391aa4d65d8310ff Change-Id: I07e4ae233979636b739f1117dd7703571e0a9366
54 lines
1.7 KiB
JavaScript
54 lines
1.7 KiB
JavaScript
( function () {
|
|
var
|
|
newPageIssueLink = require( './PageIssueLink.js' ),
|
|
newPageIssueLearnMoreLink = require( './PageIssueLearnMoreLink.js' );
|
|
|
|
/**
|
|
* Modifies the `issue` DOM to create a banner designed for single / multiple issue templates,
|
|
* and handles event-binding for that issues overlay.
|
|
*
|
|
* @param {IssueSummary} issue
|
|
* @param {string} msg
|
|
* @param {string} overlayUrl
|
|
* @param {Object} overlayManager
|
|
* @param {boolean} [multiple]
|
|
*/
|
|
function insertPageIssueBanner( issue, msg, overlayUrl, overlayManager, multiple ) {
|
|
var $learnMoreEl = newPageIssueLearnMoreLink( msg ),
|
|
$issueContainer = multiple ?
|
|
issue.$el.parents( '.mbox-text-span, .mbox-text-div' ) :
|
|
issue.$el.find( '.mbox-text' ),
|
|
$clickContainer = multiple ? issue.$el.parents( '.mbox-text' ) : issue.$el;
|
|
|
|
$issueContainer.prepend(
|
|
issue.issue.icon.$el.clone().addClass( 'mw-ui-icon-small' )
|
|
);
|
|
$issueContainer.prepend( $learnMoreEl );
|
|
|
|
$clickContainer.on( 'click', function () {
|
|
overlayManager.router.navigate( overlayUrl );
|
|
return false;
|
|
} );
|
|
}
|
|
|
|
/**
|
|
* Modifies the page DOM to insert a page-issue notice below the title of the page,
|
|
* containing a link with a message like "this page has issues".
|
|
* Used on talk & category namespaces, or when page-issue banners have been disabled.s
|
|
*
|
|
* @param {string} labelText
|
|
* @param {string} section
|
|
*/
|
|
function insertPageIssueNotice( labelText, section ) {
|
|
var $link = newPageIssueLink( labelText );
|
|
$link.attr( 'href', '#/issues/' + section );
|
|
// eslint-disable-next-line no-jquery/no-global-selector
|
|
$link.insertAfter( $( 'h1#section_0' ) );
|
|
}
|
|
|
|
module.exports = {
|
|
insertPageIssueBanner: insertPageIssueBanner,
|
|
insertPageIssueNotice: insertPageIssueNotice
|
|
};
|
|
}() );
|