Jump to content
Gov  ·  Market  ·  Community  ·  Policies  ·  Funding  ·  Open Calls  ·  Get started

MediaWiki:Mobile.js: Difference between revisions

From WikiDeal
Blank: this wiki does not load Mobile.js; fix moved to Common.css
Tag: Replaced
Always move ApprovedRevs banner to end of article (Vector-mf case: subtitle already inside bodyContent)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
/* Not loaded by this wiki (site JS disabled). Mobile section/TOC expansion lives in MediaWiki:Common.css. */
/* Not loaded by this wiki (site JS disabled). Mobile section/TOC expansion lives in MediaWiki:Common.css. */
/* ApprovedRevs banner: move to the BOTTOM of the article on mobile (Theo, 2026-08-19).
  In Minerva the subtitle is nested inside .pre-content, so CSS reordering cannot
  move it below the article. We relocate the DOM node after page load instead. */
mw.hook('wikipage.content').add(function () {
    var s = document.getElementById('mw-content-subtitle');
    var b = document.getElementById('bodyContent');
    if (s && b && s.textContent.trim() !== '' && b.lastElementChild !== s) {
        b.appendChild(s);
    }
});

Latest revision as of 08:13, 19 August 2026

/* Not loaded by this wiki (site JS disabled). Mobile section/TOC expansion lives in MediaWiki:Common.css. */

/* ApprovedRevs banner: move to the BOTTOM of the article on mobile (Theo, 2026-08-19).
   In Minerva the subtitle is nested inside .pre-content, so CSS reordering cannot
   move it below the article. We relocate the DOM node after page load instead. */
mw.hook('wikipage.content').add(function () {
    var s = document.getElementById('mw-content-subtitle');
    var b = document.getElementById('bodyContent');
    if (s && b && s.textContent.trim() !== '' && b.lastElementChild !== s) {
        b.appendChild(s);
    }
});