Collapse amboxes in edit view

In edit mode various amboxes are shown which push the editor area
below the fold.

We solved this problem already for "page issues" in normal page views
so we should apply the same solution here.

"Editing help" message will show under the heading. When clicked
information will show in an overlay.

Change-Id: Ia6e478f289267d22adc55532221cba2aae16ff36
This commit is contained in:
jdlrobson 2017-08-25 10:17:03 -05:00 committed by Jdlrobson
parent bf6d1768bd
commit b19997a970
2 changed files with 11 additions and 4 deletions

View File

@ -1,7 +1,8 @@
( function ( M, $ ) {
( function () {
var overlayManager = M.require( 'skins.minerva.scripts/overlayManager' ),
var action = mw.config.get( 'wgAction' ),
overlayManager = M.require( 'skins.minerva.scripts/overlayManager' ),
CleanupOverlay = M.require( 'mobile.issues/CleanupOverlay' );
/**
@ -50,7 +51,7 @@
* @ignore
*/
function createBanner( $container, labelText, headingText ) {
var selector = 'table.ambox, table.tmbox, table.cmbox',
var selector = 'table.ambox, table.tmbox, table.cmbox, table.fmbox',
$metadata = $container.find( selector ),
issues = [],
$link;
@ -100,11 +101,16 @@
$container = ns === 14 ? $( '#bodyContent' ) :
M.getCurrentPage().getLeadSectionElement();
if ( $container === null ) {
if ( action === 'edit' ) {
$container = $( '#mw-content-text' );
} else if ( $container === null ) {
return;
}
if ( ns === 0 ) {
if ( action === 'edit' ) {
createBanner( $container, mw.msg( 'edithelp' ),
mw.msg( 'edithelp' ) );
} else if ( ns === 0 ) {
createBanner( $container, mw.msg( 'mobile-frontend-meta-data-issues' ),
mw.msg( 'mobile-frontend-meta-data-issues-header' ) );
// Create a banner for talk pages (namespace 1) in beta mode to make them more readable.

View File

@ -264,6 +264,7 @@
"mobile.betaoptin"
],
"messages": [
"edithelp",
"mobile-frontend-language-change",
"mobile-frontend-meta-data-issues",
"mobile-frontend-meta-data-issues-talk",