mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/MinervaNeue
synced 2024-11-25 06:36:32 +00:00
3dc9cff2c2
- Move page issue view components that do not modify the DOM during during construction to PageIssueLearnMoreLink.js and PageIssueLink.js. PascalCase is used optimistically for filenaming in the hopes that these functions can become something like a JSX component. A "new" function prefix is used in the meantime. - Move page issue view logic that munges the existing DOM to pageIssueFormatter.js. Substitute "create" prefixes for insert so that clients won't forget that calling the function is a modify operation. Alternative naming welcome but it shouldn't be confused with more idealistic components that do not depend on DOM state for construction. - Consolidate createPageIssueBanner() and createPageIssueBannerMultiple() into insertPageIssueBanner() as the code was quite similar and were it a true component, it would probably be a single component. All new files appear under page/ to keep their distinction from the overlay code clear. Some view logic remains in pageIssues.js but it shall be difficult to isolate. Bug: T212376 Change-Id: Iccce709c34fa8de5a28a5a00098add5775e3dc9a
14 lines
405 B
JavaScript
14 lines
405 B
JavaScript
( function ( M ) {
|
|
/**
|
|
* Create a link element that opens the issues overlay.
|
|
*
|
|
* @param {string} labelText The text value of the element
|
|
* @return {JQuery}
|
|
*/
|
|
function newPageIssueLink( labelText ) {
|
|
return $( '<a>' ).addClass( 'cleanup mw-mf-cleanup' ).text( labelText );
|
|
}
|
|
|
|
M.define( 'skins.minerva.scripts/page-issues/page/PageIssueLink', newPageIssueLink );
|
|
}( mw.mobileFrontend ) );
|